Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Scrolling a form

Posted on 2004-09-28
3
Medium Priority
?
161 Views
Last Modified: 2010-05-02
Hello,

I have a form which runs off the user's screen, but only at resolution 800x600. (I don't really care about 640x480). I need to make this a scrollable form, but only for this resolution (or only when the form runs off the screen) It runs off at the bottom only, and I am centering the form in the middle of the screen. Further complicating things, this form has a picture as a background. I line up various controls (buttons, textboxes, etc.) to areas of the picture, so simply moving all the controls around will not work. I've found code which illustrates how to make a form scrollable and moves all form elements (using a picturebox I believe), but I need code that can detect the user resolution or when a form runs off the screen, and only in that case add a scrollbar to the form.

Any suggestions?
0
Comment
Question by:rite_eh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
VBtorment earned 980 total points
ID: 12174767
Yo, rite

maybe ya can use the screen object
try this
put this on Form_Load

MsgBox (Screen.Width / Screen.TwipsPerPixelX) & " " & (Screen.Height / Screen.TwipsPerPixelY)

it will show a messageBox with the resolution you are using.
0
 
LVL 1

Author Comment

by:rite_eh
ID: 12177016
I had no idea this object existed. That is very helpful. Do you know of a way to reposition a window in the center of the user's screen at runtime?
0
 
LVL 8

Assisted Solution

by:mladenovicz
mladenovicz earned 400 total points
ID: 12177776
Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question