I know that adding controls to a form is a bad idea. The database is off-line when I add controls, so I was not worried about instability. I am investigating the possibility of automating a very significant list of manual updates (25 steps on a check list) to an Access database, which includes adding check box controls. I just discovered yesterday that a CheckBox has a Label as a child control. I didn't realize that the child control was added automagically.
I have been digging through a lot of VBA code to understand this problem, so I just need the steps, not necessarily the C# code (I can handle that).
Main Topics
Browse All Topics





by: LSMConsultingPosted on 2009-03-24 at 10:12:51ID: 23970736
If you're trying to add a label for the Checkbox, then you shouldn't have to ... it should already have a Label associated with it ... in VBA we'd refer to it like:
Checkbox.Controls(0)
But I'm not sure how you'd do that in C.
Also, adding controls and such to a runtime form is a bad idea. It will decompile your application, resulting in instability and possible corruption. Can you not simply add the checkbox and hide/show it as needed? That's the way it's done in Access.