krotfoto.blogg.se

How to insert a control end in word 2016
How to insert a control end in word 2016






Something like this: Public Function FindOptionGroupLabel(ctlOptionGroup As Control) As Control

How to insert a control end in word 2016 code#

To avoid this problem, I can imagine convoluted code where you looped through the option group's Controls collection looking for the labels attached to the option/toggle buttons, and then looped through the option group's Controls collection a second time, this time looking only at the labels. If that's not the case, you need to name the label and refer to it by name, because the labels for the option/toggle buttons are part of the option group's Controls collection (this surprised me - I expected them be only in the Controls collection of the option/toggle button to which they were attached). So, for the caption of an option group lable, you either want to be careful that if you delete the default label, you also delete the controls inside the frame after you add the label back. But if, for instance, you delete the default label, add option buttons and then add back a label, it will not be index 0, but index. When you drop an option group on a form from the form tools toolbar, the frame is created with an attached label, so it will be the control with index 0. Controls(0) will throw an error.Īn Option Group has multiple controls, the label and the option button or toggle buttons inside the frame.

how to insert a control end in word 2016 how to insert a control end in word 2016 how to insert a control end in word 2016

TextBoxes, ComboBoxes, ListBoxes, CheckBoxes have a maximum of 1 item in their controls collection (the attached label), but if the label isn't attached, they won't even have that, so. Has provided the correct answer, but keep in mind that not all controls have the same kind of Controls collections.






How to insert a control end in word 2016