Member Avatar for onaclov2000

Hello, I wrote a little slide in box, that slides in from the edge of the screen, the problem i'm having is that I don't always know the size of the desktop if that makes sense, as well as spacially where things are, I.E. Suppose the start menu is on the right screen, with a second desktop on the left, I setup the position of the box according to that, then I move to another desktop where the left screen is the display with start menu, now the form is on the left edge of the secondary screen BUT now it's showing up on the left screen, since the secondary display is right of the primary, this is not awesome, any tips on how to resolve this issue...I hope i've explained myself clearly, if not I'll try to provide more details if needed.

Doesn't this all depends on how you place your monitors?
One monitor is always the primary depending on which graphics port you use on your computer.

In either case, perhaps you should take a look at the Screen class?
More specifically the property AllScreens which contains a collection of all screens.

You can check for the Primary screen with this:

If Screen.AllScreens(0).Primary Then
     '' Code for displaying box on the seconday screen
     '' using Screen.AllScreens(1).Bounds or .WorkingArea
Else
     '' Code for displaying box on the primary screen
     '' using Screen.AllScreens(0).Bounds or .WorkingArea
End If
Member Avatar for onaclov2000

Sorry it took so long, I don't always get back to projects right away at work unless they're critical need, which this one wasn't....I believe your idea works, I hadn't tried it before....I now have to test it on another screen though.....either way I'll mark it solved...don't know why I didn't think of that... I knew that those things existed I just didn't think to put the pieces together!!!! Thank you, onaclov

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.