c# - Dynamically Create Checkbox With Scrolling -


i'm trying build form application in visual studio 2010 using c#.

the program reading excel file contains list of filenames, , dynamically generate textbox each filename.

below code, clarification. wanted make label link file, that's why didn't use checkboxes[i].text = filename

checkbox[] checkboxes = new checkbox[filecount]; label[] labels = new label[filecount]; (int = 0; < filecount; i++ ) {     //creating checkbox     checkboxes[i] = new checkbox();     checkboxes[i].location = new point(360, (145 + * 30));     checkboxes[i].name = string.format("checkbox{0}", i.tostring());     this.controls.add(checkboxes[i]);      //creating filename label     labels[i] = new label();     labels[i].location = new point(20, (150 + * 30));     labels[i].text = existingfiles[i];     labels[i].width = 330;     this.controls.add(labels[i]); } 

say if filecount equals 100, make form big/long , won't able fit on monitors.

is there way make dynamically generated checkboxes , labels grouped in area , have user able scroll? panel scrolling? don't know if there's that.

i thought using checkedlistbox, doing way won't able make filename link. want user able click on label , file opened automatically, instead of selecting it.

any appreciated!

most controls have autoscroll property. set true, , control automatically add scrollbar when necessary. can use panel control , add of links/checkboxes (if don't want whole form scroll).


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -