|
-
Jul 19th, 2004, 09:23 AM
#1
Thread Starter
Lively Member
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
-
Jul 19th, 2004, 10:04 AM
#2
PowerPoster
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.
-
Jul 19th, 2004, 10:13 AM
#3
Thread Starter
Lively Member
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 ?????
-
Jul 19th, 2004, 10:19 AM
#4
PowerPoster
Hi,
Take out that new declaration completely.
Set the Modifiers property of the StatusBar to Public.
use:
VB Code:
Private Sub ClientName_TextBox_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ClientName_TextBox.MouseEnter
frmMainMenu.StatusBar1.Text = "Enter Client Name"
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.
-
Jul 19th, 2004, 10:35 AM
#5
PowerPoster
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.
-
Jul 19th, 2004, 10:56 AM
#6
Thread Starter
Lively Member
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
-
Jul 19th, 2004, 11:14 AM
#7
Hyperactive Member
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)
-
Jul 19th, 2004, 11:59 AM
#8
PowerPoster
Hi,
As I said it should be
VB Code:
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
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.
-
Jul 19th, 2004, 11:06 PM
#9
Thread Starter
Lively Member
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
-
Jul 20th, 2004, 02:08 AM
#10
Fanatic Member
hello mates. i've got this. hope this helps.
VB Code:
' On Form1 which contains the StatusBar1
Private Sub mnuNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuNew.Click
Dim f As New Form2(Me)
f.MdiParent = Me
f.Show()
End Sub
' On Form2 which has the TextBox1
Dim f As Form1
Public Sub New(ByVal f As Form1)
MyBase.New()
Me.f = f
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
' . . .
Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
f.StatusBar1.Text = sender.text
End Sub
-
Jul 20th, 2004, 03:24 AM
#11
Hyperactive Member
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)
-
Jul 20th, 2004, 03:28 AM
#12
Fanatic Member
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.
-
Jul 20th, 2004, 04:30 AM
#13
PowerPoster
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:
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.
-
Jul 20th, 2004, 11:43 AM
#14
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|