Results 1 to 14 of 14

Thread: MDI problem - about status bar

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108

    MDI problem - about status bar

    i have a parent form call main and at the parent form have a status bar, and i have a child form call abc form , i want to know how to set the status bar text when i mouse move to the textbox at the child form ???

    i have using the code below but the status bar didnt display anything

    Code:
        
    
    Private Sub ClientName_TextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClientName_TextBox.MouseEnter
    
    Dim main As New MainMenu
    main.StatusBar1.Text = "Enter Client Name"
    
    End Sub
    please help thank you

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    Of course not! Why have you created a new MainMenu when you have already done so in design mode?

    If you have not changed the default name your code should be:
    [Highlight=VB]
    Private Sub ClientName_TextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClientName_TextBox.MouseEnter

    MainMenu1.StatusBar1.Text = "Enter Client Name"

    End Sub
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108
    cannot

    the status bar is at my mainmenu form, and the abc is my child form, it is different form

    if i didnt declair the name it will display an error

    example the status bar is at my main menu - parent form, and the client form is the child of the parent form - it is different form

    so how can i set the status bar word ???? if i move movein the client form textbox ?????

  4. #4
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,


    Take out that new declaration completely.

    Set the Modifiers property of the StatusBar to Public.

    use:

    VB Code:
    1. Private Sub ClientName_TextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClientName_TextBox.MouseEnter
    2.  
    3. frmMainMenu.StatusBar1.Text = "Enter Client Name"
    4.  
    5. End Sub
    Last edited by taxes; Jul 19th, 2004 at 10:33 AM.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  5. #5
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    HI,

    Sorry, My tiny mind has been confused by your choice of form names. I have now amended ny previous post on the assumption that your main form is instances under the name

    frmMainMenu

    and that your status bar is names

    StatusBar1
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108
    when i take the declaration out

    is say my statusbar1 is not declair and got error

    ok my main menu got onestatus bar , and my child form call abc dont have the status bar and it depend on the parent status bar, and i want to set the child form when the mouse point to the client name text box in the abc form and the main menu status bar will display the word that i want.



    thank you

    the code below is at my abc form not my main menu form

    Code:
        Private Sub ClientName_TextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClientName_TextBox.MouseEnter
    
    StatusBar1.Text = "Enter Client Name"
    
    End Sub

  7. #7
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    Hi Ninja, hi Taxes. As often (always!) I'm a little confused.....excuse me Taxes, help me to understand, please....is it possible the problem is only due to the fact that Ninja can't refer MainForm? It's a classic problem that I know you perfectly Know, better than me. Probably I'm missing some details, but if it was the case, the solution, dear Taxes, is that one you perfectly know (declare formmain as public in a module, so you can access to its controls) and you can explain it to our friend Ninja with less difficult than me. Or I'm completely out of the question?
    Live long and prosper (Mr. Spock)

  8. #8
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    As I said it should be

    VB Code:
    1. Private Sub ClientName_TextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClientName_TextBox.MouseEnter
    2.  
    3. MainMenu1.StatusBar1.Text = "Enter Client Name"
    4.  
    5. End Sub

    And your StatusBar modifier property should be Public and (I forgot to say, form mainmenu should be declared Public in the module. Thanks alextyx
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108
    Sorry
    i got a question want to ask

    i already declair the statusbar to public

    and if i remove the Dim main As New FirstPage

    i cannot use the statusbar

    but if i use the Dim main As New FirstPage

    i can use but the status bar didnt display anything

  10. #10
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    hello mates. i've got this. hope this helps.
    VB Code:
    1. ' On Form1 which contains the StatusBar1
    2.    Private Sub mnuNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuNew.Click
    3.       Dim f As New Form2(Me)
    4.       f.MdiParent = Me
    5.       f.Show()
    6.    End Sub
    7.  
    8. ' On Form2 which has the TextBox1
    9.    Dim f As Form1
    10.    Public Sub New(ByVal f As Form1)
    11.       MyBase.New()
    12.       Me.f = f
    13.  
    14.       'This call is required by the Windows Form Designer.
    15.       InitializeComponent()
    16.  
    17.       'Add any initialization after the InitializeComponent() call
    18.  
    19.    End Sub
    20.  
    21. ' . . .
    22.    Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
    23.       f.StatusBar1.Text = sender.text
    24.    End Sub

  11. #11
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    Dear B.M., you always wonder me!
    I have not tested your code. I assume it works, anyway.
    It's a very interesting approach. I'll try it when I'll have a good opportunity!
    Good job to you,Taxes and Ninja. Bye friends!
    Live long and prosper (Mr. Spock)

  12. #12
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    hello alextyx [ friend ]. hehe. i don't even know if this the efficient one. perhaps taxes has a better idea and some expertz here [ warning: i'm not one of them ]. cheers mates.

  13. #13
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi Ninjaz,

    We are going round in circles and it is not clear from the language you use exactly what you have done.

    1. You do NOT declare the StatusBar as public. You have placed the statusbar on the form MainMenu at design time and you should then set the StatusBar Modifiers property to public. You do this in the properties window.

    2. Stop naming your forms with names which have other meanings in VB.NET. There is a control called "MainMenu".

    3. Where and how have you created the instance of the form you call MainMenu? It should be declared as Public.

    4. Have you used the following code?

    VB Code:
    1. Private Sub ClientName_TextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClientName_TextBox.MouseEnter
    2.  
    3. MainMenu1.StatusBar1.Text = "Enter Client Name"
    4.  
    5. End Sub
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108
    ok thanx ~ i using another way to soft the problem ~

    thank you for your guys help ~

    sorry to disturbing u all

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