Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dual monitor setup 1

Status
Not open for further replies.

csutton

Programmer
Dec 27, 2000
213
US
I was wondering if anyone has any tips on how to run VB.NET IDE & the application you're programming on 2 monitors.

I have a laptop for programming, and it has a VGA-out so I can connect a monitor to it, and use dual displays. I'd like to keep the IDE on my laptop screen, and have my program (when running) on the 2nd display.

Must I manually set the window positions of my program in code so it goes that second display? Or does anyone have any suggestions/tips on how to do this?

thanks
Chris
 
If you have two monitors, you can usually double the .Width for the second monitor (if it's on the right). Just move the form to the location plus the width/height of the first screen. Note that it will only work right on dual-monitor setups.

-David
2006 Microsoft Valued Professional (MVP)
 
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Me.DesktopLocation = Screen.AllScreens(1).Bounds.Location

End Sub
 
Thank you SHelton, that looks like it'll work great!!!
 
SHelton -

Guess I was a little quick on the star link :)

It doesn't work :) It still ends up on the primary monitor (laptop), when I need it to go to the monitor on the right.

Any other suggestions?

Thanks
 
Make sure that there is no other code that changes any aspect of the form, such as minimum or maximum sizes, window state etc.

I tried it on a quickie single form project and it worked okay - I'll give it a go on a "proper" project and see what I get.

Incidentally, I am using dual monitors on a laptop dock station, so it may be that you are using the VGA out for the second monitor ?
 
Yes, I'm using the VGA out. Its a high-end laptop, and it shows that it is 2 displays vs 1 display. I'll check the settings. I will also run a quick test app to see if it is my code or if it is maybe hardware related.

thanks again and i'll let you know how I make out.

Chris
 
HShelton -

Ok, I've determined that it must be my original code. I am creating an MDI application. Would that have anything to do with it? If i use maximize, etc., do I have to set the desktoplocation again ?

Thanks
Chris
 
Ok, I think I found the problem, atleast one of them, if the others haven't shown their head yet! :)

I had WindowState defined as maximize on the form itself. When this was set, it would not work on the 2nd monitor.

Once I set the windowstate to normal on the form, everything would work fine. I can even use maximize, minimize, etc. and it stays on the 2nd monitor.

Anyway, thanks for your help, and hopefully someone else will find this helpful.
 
I thought this was built in with video cards such as nView with NVIDIA cards. I believe it will let you set certain executables to run on certain monitors. That would seem the easiest to me.
 
Hi Riverguy --

Um, maybe on some cards, but I have an ATI video on my laptop, and it doesn't have that option (atleast anywhere I can find).

So, yeah that may be easiest, but if someone doesn't have that option, then the above works too..

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top