Question controls cannot be added to the form?

gs99

Active member
Joined
May 8, 2010
Messages
42
Programming Experience
Beginner
1. What determines that some controls cannot be added to the form?
(I tried several, not all of them)

2. Where does the image for Column 1 About form come from?
 
1. Which did you have in mind?
2. from the template.
 
(Original thread title was: NET 3.5 VB Windows Form - About Box)

1. I'm not (at this point) needing to add any specific control; just trying to learn how things work.

What property of a class prevents controls to be added?


2. I assume the Template operates within the definitions of a NET class.
E.g. in a Windows Form class, it changes the Size property to a default size.
So the Template adds the image to the "About Box" Class, but what property is involved? How can the image be changed?

Thanks
 
Last edited:
Answer to question 2:

Regarding the About Box image,
I can get my answer by showing form properties, then selecting the down arrow that shows all controls on the form.

I assume the image can be modified thru Designer.

Thanks again for your help
 
2. I assume the Template operates within the definitions of a NET class.
E.g. in a Windows Form class, it changes the Size property to a default size.
The About form is a preconfigured template based on the regular Form class only adding some controls/settings/code, when you add a About box to your project this template is copied as is. You can then use it as is or customize it further same as you would with any form using Designer and adding code. The template has a preconfigured size, you can change the size of the form in Designer.
1. I'm not (at this point) needing to add any specific control; just trying to learn how things work.

What property of a class prevents controls to be added?
You can only add components and controls to a form, ie classes that inherits Component/Control classes or derived.
Regarding the About Box image,
I can get my answer by showing form properties, then selecting the down arrow that shows all controls on the form.

I assume the image can be modified thru Designer.
If you click that image in Designer the Picturebox control that displays it is selected, then you can change the image in Properties window using the Image property.
 
You can only add components and controls to a form, ie classes that inherits Component/Control classes or derived.

The About Box inherits from Form.
Apparently About Box does something that disables the ability to add controls.
I'm asking how it does that.
 
Apparently About Box does something that disables the ability to add controls.
Within the About form there is a docked TableLayoutPanel, this layout control will only allow one control in each cell. You'll have to rearrange that grid.
 
Thanks for your kind help, JohnH.

I tested this on a regular Form1:

Add a TableLayoutPanel, with default 2-column, 2-row grid.
Add one control in each cell.
Try to add a second control in any cell; the "Prohibited" icon appears in the cursor.

Delete a control; then another control can replace it.

So the "cannot add control to form" is due not to the About Box itself but to a restriction of the TableLayoutPanel.

Thanks
 
Back
Top