Click here to Skip to main content
15,889,857 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
The code correctly displays my form on the second screen but I have three questions
1. How do I locate the form on the screen (ie centered, at 200,200, or other locations)
2. How do I ensure it will work when run on a PC with a single screen?
3. I need to pass a structure (single record to the second form). I have a db of 25,000 records and when one of those users is trying to register in the new db their information needs to be displayed on the second form for their registration.

Thanks for any help
Jack

VB
Structure User
    Dim First As String
    Dim Middle As String
    Dim Last As String
    Dim Addr1 As String
    Dim Addr2 As String
    Dim City As String
    Dim State As String
End Structure

Dim My_Users(25000) As User

Private Sub Legacy_User_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Legacy_User.Click
        Dim form As New Legacy_Screen()
        Dim screen As Screen
        ' Display a form on second screen (0, 1)
        screen = screen.AllScreens(1)
        ' Set the StartPosition to Manual otherwise the system will assign an automatic start 
        form.StartPosition = FormStartPosition.Manual
        form.Location = screen.Bounds.Location
        ' Show the form
        form.ShowDialog(Me)
    End Sub
Posted
Updated 30-Jul-11 16:20pm
v2

First, you have to determine if a 2nd monitor is even attached to the system, and if so, WHERE it is in relation to the primary monitor. Once you've done that, you can easily change the location of the 2nd form so that it appears on the 2nd monitor.

You do NOT need to pass all 25,000 users to form 2 - just the one that's doing something. Right?

Go back to my answer to your previous question for instructions for this.

As far as determining how many monitors are attached to the system and their relative locations, google is your friend.
 
Share this answer
 
John

"First, you have to determine if a 2nd monitor is even attached to the system, and if so, WHERE it is in relation to the primary monitor. Once youve done that, you can easily change the location of the 2nd form so that it appears on the 2nd monitor."

Wow I could never think of that? And since I stated that the code is displaying on the second screen I wonder exactly how much you read before posting?

"You do NOT need to pass all 25,000 users to form 2 - just the one that doing something. Right?"

Very perseptive you now have subposedly looked at two of my posts and almost know what I am asking?

TRY reading #3 above! I wish you would read alittle before posting.

"Go back to my answer to your previous question for instructions for this."

John JUST GO AWAY!!!

Your responses show your lack of interest in my question and less interest in helping--you simply want to pad your ego! I stated your response was clear as mud if I knew the answer I wouldnt ask the question.

Here is for your ego.

Well ladi dah you know more VB than I do, that is SOOOO impressive since I started my first VB project 3 weeks ago. I am NOT a VB programmer I write in C!

I have written more code than you have used, but I am a newbie in VB. I am impressed when someone knows something and can explain it you obviously are someone I look at with pity to have such an ego and so little talent to back it!

Bye

Don't bother to respond I would rather get no response than to have to see your name again!
 
Share this answer
 
for others needing the answer

http://msdn.microsoft.com/en-us/magazine/cc164124.aspx
 
Share this answer
 
Comments
Member 8123048 31-Jul-11 10:52am    
I needed something simple therefore:

Module Module1
' User Structures 25,000 for Both Systems
Public Legacy_User(25000) As User
Public User_Count As Integer
Public Record As Integer
End Module

Works making the information available across forms as I need. Effective since the forms are reading multiple db's amazing how simple the solution is.

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900