I am finding it very difficult to see how checkboxes and other controls can be placed on a form at runtime. I wish to read control names stored in a table and place a checkbox on a form for each entry in the table.
A control on a form is an item in the form's Controls collection.
THEREFORE all you have to do is add a new control object to the form's Controls collection, specifying the control object's type, top, width, height etc., etc., etc.
'ope-that-'elps
G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D
I don't think this is possible, unless you open the form in design view, create the controls, then reopen in form view.
Another (probably better) way to do it would be to create all the controls you'll ever need (say, 100) call them chkCheckBox0, chkCheckBox1, chkCheckBox2 etc. (also lblLabel0, lblLabel1 ...) and make them invisible.
Then you can manipulate them in code, making them visible as you need them. You should be able to move them in form view, just not create them.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.