Results 1 to 2 of 2

Thread: Please help b4 I lose my mind!

  1. #1

    Thread Starter
    Lively Member brjames's Avatar
    Join Date
    Jan 2000
    Location
    Tenby, Wales, UK
    Posts
    121
    I am creating a harbour management system and have nearly finished it but I have been stuck on the same problem for about 3 hours now and it's stressing me out!

    I have a picture of the harbour and the users are gonna be able to click on the individual boats and view the information about that particular boat on the screen. I have worked out all the co-ordinates needed but I need to be able to re-use the same form rather than have a different form for each boat.

    I am able to click on each boat and bring up the form but I don't know how to display the different information for each boat.

    The code I have so far is below:

    Private Sub cmdExit_Click()
    End
    End Sub

    Private Sub cmdViewlifeguard_Click()

    Load Lifeguardlist
    Lifeguardlist.Show
    Unload MainMenu

    End Sub

    Private Sub Command1_Click()
    Load Mooringslist
    Mooringslist.Show
    Unload MainMenu
    End Sub

    Private Sub Form_Load()
    Label2.Caption = Date
    Picture1.Picture = LoadPicture("C:\harbour management\harbour2.jpg")
    End Sub


    Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If X < 4740 And X > 4290 And Y < 3525 And Y > 3480 Then
    Load Mooringinfo
    Mooringinfo.Text1

    Unload MainMenu

    End If

    If X < 4590 And X > 4095 And Y < 3285 And Y > 3150 Then
    Load Mooringinfo
    Mooringinfo.Show
    Unload MainMenu

    End If

    If X < 4560 And X > 4065 And Y < 3075 And Y > 2940 Then
    Load Mooringinfo
    Mooringinfo.Show
    Unload MainMenu

    End If

    If X < 4560 And X > 4110 And Y < 2850 And Y > 2730 Then
    Load Mooringinfo
    Mooringinfo.Show
    Unload MainMenu

    End If

    If X < 4500 And X > 3945 And Y < 2655 And Y > 2580 Then
    Load Mooringinfo
    Mooringinfo.Show
    Unload MainMenu


    End If
    End Sub

    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Text1.Text = "X: " & X & " Y: " & Y

    End Sub

    Private Sub Timer1_Timer()
    Label1.Caption = Format(Now, "Long Time")
    End Sub

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    you can set valeus for textboxes etc between loading a form and showing it

    is MainMenu a form?
    if yes, is it THIS form?
    if it is, hide it rather than trying to unload it



    Code:
    If X < 4590 And X > 4095 And Y < 3285 And Y > 3150 Then 
    Load Mooringinfo 
    
    Mooringinfo.text1 = "whatever"
    
    Mooringinfo.text2 = "whatever2"
    
    Mooringinfo.text3 = "whatever3"
    
    Mooringinfo.Show 
    Unload MainMenu 
    
    End If
    Mark
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width