RE: How to change windows form size

VB2008

New member
Joined
Feb 1, 2008
Messages
3
Programming Experience
1-3
RE: How to change windows form size

Hi.

I am having trouble setting the form size (either width or height) to a size other than maximum screen size (set by screen resolution). In my application, the form is opened in a panel as a child form in another form and I set formborderstyle property of the child form to "None".

I want to open a child form that is 800 x 1036 in the parent form with autoscrolling set to "on". When I changed the height of the child form to 1036, it automatically changes to 912 which is 12 over my screen height that is 900 pixels.

How can I set the form size to larger that screen resolution and use scroll bar in the parent form to scroll through the child form?

Any help is appreciated.:)

Thanks,

Amir
 
The reason I am using a form is that I want to insert an image of an application form on vb form and place text boxes on the the form to regenerate application entries.

I am not sure if I can do that with UserControl.

Amir
 
You said you've removed the border of the form and embedded it in a Panel. In that case the form offers you no visual difference to a UserControl. A UserControl is a control that allows you to use a number of child controls as a single unit. That sounds like exactly what you want.
 
Thanks jmcilhinney.

I have quite a few forms which then I have to build as user contorls. Can I use these user controls directly in my application just like any other form and refer to them (or controls within them) in other forms? Essentially this is what I need to do.

I also read in other sources that I have to build each user control as a dll file and then add it to the tool box as a customized control. Is this the only way to use them? Can I have more than one user control bundled together in a single dll file?

Thanks for your help.

Amir
 
A UserControl is just a control. A control is just a class that inherits the Control class so you can display it in the UI. You can have as many classes as you want in the same project.

If you create a UserControl then it is automatically added to the Toolbox for the solution in which it's declared. If you want to use it in other solutions then you can add it to the Toolbox manually in a few seconds, just like any control.

As I said, the point of a UserControl is to allow you to create a group of child controls that work together as a unit, then create instances of that wherever they are needed. A UserControl is just a control, so you can use it anywhere you can normally use controls.
 
Back
Top