Arata
Arata
CC#
Created by Arata on 9/25/2024 in #help
trying to fix a bug where i cant get the click event on a buttom
hello, i have an issue with a windows form program, i have a panel where buttons gonna be placed, and i have a TableLayoutPanel that component gonna be the layout to the buttons "styles" i mean
buttonLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 70F)); // 70% for the image
buttonLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 30F)); // 30% for the text
buttonLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 70F)); // 70% for the image
buttonLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 30F)); // 30% for the text
only that, and the problem is the next
buttonLayout.Controls.Add(icono, 0, 0); // image in the fisrt row
buttonLayout.Controls.Add(texto, 0, 1); // text in the second row

// add TableLayoutPanel to the buttom
btn.Controls.Add(buttonLayout);

// add buttom to the main TableLayoutPanel
tableLayoutPanel.Controls.Add(btn, colIndex, rowIndex);
buttonLayout.Controls.Add(icono, 0, 0); // image in the fisrt row
buttonLayout.Controls.Add(texto, 0, 1); // text in the second row

// add TableLayoutPanel to the buttom
btn.Controls.Add(buttonLayout);

// add buttom to the main TableLayoutPanel
tableLayoutPanel.Controls.Add(btn, colIndex, rowIndex);
the button stay behind the "style panel" and it goes untouchable, i tried a couple of things but i cant reach the buttom click event
73 replies