views:

2303

answers:

4

I have a VB6.0 project and I want to convert it in VB.Net.

In my VB6.0 application some of the MDI Child form’s height is 17000 and width is 13000. Now I want to set the same form size in VB.Net forms, but it allows maximum form width = 1036, height = 780 for resolution 1024x768.

How can I increase form size with same resolution?

Also I want to print this from so, I can not use auto scroll property of vb.net forms.

Thaks

A: 

I think the VB6 units are not the same with the VB.Net one. So you have to do a conversion.

John
+3  A: 

Your classic VB units are in what are called "twips". You will most likely be able to divide those numbers by 12 or 15 (depending on if you are using large or small fonts) and you will get a certain number of pixels.

Matt Dawdy
A: 

Hi, I done some Googling on this, and came across this..

Yes, this size of the form is limited to the size of the desktop (more specifcally SystemInformation.MaxWindowTrackSize). This is done in the Form.SetBoundsCore protected virtual method. This behaviour cannot be changes or at least without a great deal of work and using PInvoke.

Also supported here

The size of the form in the designer is limited by your screen size.

It sounds like you have your display at 1600x1200, hence the designer won't let you go larger then 1212.

If you had your display at 1280x1024, then the designer wouldn't let you go larger then 1036.

I'm not really sure why the size of the form in the designer is limited to the screen size, as I may deploy on a machine that has a larger screen size them my development machine...

So looks like it cannot be done.. Thats some strange behaviour since it looks like you are limited to whatever your dev machine is..

I think the only way to do it is to size to the maximum resolution possible, set the form size, then revert back, but never touch the size again.

Rob Cooper
+1  A: 

You are limited in the designer, but not in code:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.Height = 17000 'or whatever you need
    Me.Width = 13000
End Sub
Eduardo Molteni
I just tested this suggestion. This suggestion does not work in the form_load event. The initial size of the form will be limited to the screen size, as the per the question.
jm