*********************************
Method #1
*********************************
One way is to come up with 2 settings:  800x600 and 1024x768(or greater).

When your program starts, you find the users screen resolution like this:

theWidth = screen.width
theHeight = screen.height

(Applause, Applause!  No fancy API is necessary for this!)

Now that your code knows the user's screen resolution you can then position
your controls accordingly:

cmdSave.move (100, 200, cmdSave.width, cmdSave.height)
txtInput.move(700, 200, txtInput.width, txtInput.height)

and so on.

*********************************
Method #2
*********************************

you can also "rubberize" your form by using the Form_Resize() Routine.

This is a teadious task, especially if you have many controls on your form.

Following is some code from one of my productional programs:

Private Sub Form_Resize()
    lstCustomers.Left = 100
    lstCustomers.Width = frmExportAllCustomers.Width - 200
    lstCustomers.Top = 100
    lstCustomers.Height = frmExportAllCustomers.Height - 1200
    cmdExport.Top = frmExportAllCustomers.Height - cmdExport.Height - 500
    cmdExport.Left = frmExportAllCustomers.Width / 2 - (cmdExport.Width / 2)
End Sub

This is from a form with very few controls.  Obviously if there are a lot of
controls and every control positions itself off of the control before it
this can get CrAzY - it is also a lot of fun if you have time on your hands.

***********************
Method 3
***********************
You can find a 3rd party control that will do this for you.
I think .NET will also do it for you.



----- Original Message ----- 
From: "m50h" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 29, 2004 3:48 AM
Subject: [vbhelp] position of controls automaticlly depend on resolution


> Dear Mr. / Mrs.
>
> I have a question that it appears in all my projects.
> For example I write a program with my computer that its resolution
> is 1024*768 and setting my controls on that but if I run my program
> on a computer with 800*600 resolutions the position of controls
> isn't good for this computer.
>
> Please help me how can I set my postion of controls automaticlly
> deppending on my resolutions.
>
> Thanks for your answer before.
> Best regards,
> Mohsen Hakimi.
>
>
>
>
>
>
>
> '// =======================================================
>     Rules : http://ReliableAnswers.com/List/Rules.asp
>     Home  : http://groups.yahoo.com/group/vbHelp/
>     =======================================================
>     Post  : [EMAIL PROTECTED]
>     Join  : [EMAIL PROTECTED]
>     Leave : [EMAIL PROTECTED]
> '// =======================================================
>
> Yahoo! Groups Links
>
>
>
>
>




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/k7folB/TM
---------------------------------------------------------------------~->


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to