Solved

Scrolling a form

Posted on 2004-09-28
3
159 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 245 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 100 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

710 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