I am trying to figure out exactly how to get mywindow to center itself no matter what the resolution of the screen is that it is beingdisplayed on is. I’m a beginner so go easyon me. Thank you very much.
OK…here’s how you do it. The Screen object always contains the screen resolution. Put this code into your Form_Load event.
Sub Form_Load() Me.Top = (Screen.Height – Me.Height) / 2 Me.Left = (Screen.Width – Me.Width) / 2End SubScreen is a system object that is always available. Me refers to the current Form where this code is located. Drop this in and it will work. However, you should always check the value you’re putting into the Left or Top properties to verify that it is valid. There are some strange circumstances that can cause those values to be negative.