c# - Autosize not working of Table Layout Panel in Winform? -
this question has answer here:
i making windows application,in using table layout panel, structure of table layout panel is:
total columns : 1 -> autosize total rows : 6 -> autosize
in code behind adding 4 radio buttons , text of radio buttons bit long , dont want text in single line, want line-wrap property,code adding radio buttons :
(int = 0; < 4; i++) { rbtn1 = new radiobutton(); rbtn1.name = "rbtn" + (i + 1); rbtn1.text = "a jogger running @ 9 kmph alongside railway track in 280 metres ahead of engine of 120 metres long train running @ 45 kmph in same direction. in how time train pass jogger?"; rbtn1.dock = dockstyle.fill; rbtn1.font = new font("verdana", 10); tablelayoutquestionanswer.controls.add(rbtn1, 1, i+1); }
my final result :
text after "train" not appearing . solution this, trying last 2 days, need help, lot.
if set radiobutton's autosize value false, , specify width value, words wrapped.
rdbbutton.autosize = false; rdbbutton.width = 100;
Comments
Post a Comment