|
-
May 14th, 2000, 09:45 PM
#1
Thread Starter
Lively Member
I have certain code that get processed on a LostFocus event in a textbox on a MDI Child.
This code will not get processed if I choose a menu item from the MDI Form(parent).
Is there any way to force the LostFocus to fire in this text box when a menu item is chosen from the MDI Form...or any other event that causes the LostFocus event not to be triggered.
Thanks for the help.
-
May 14th, 2000, 10:38 PM
#2
Lively Member
?
Have you tried to set focus to the other form on the event?
-------------------------
There is never only one right answer. That is the magic of programming.
-------------------------
-
May 15th, 2000, 02:42 AM
#3
Thread Starter
Lively Member
Yep I thought that would work but for some reason it didn't.
Unsure as to how to proceed.
-
May 15th, 2000, 02:58 AM
#4
Lively Member
send me the code
IF YOU CAN GIVE ME A CODE EXAMPLE ON HOW YOUR DOING IT... IT WOULD HELP ALOT.
-------------------------
There is never only one right answer. That is the magic of programming.
-------------------------
-
May 15th, 2000, 03:21 AM
#5
Thread Starter
Lively Member
Sure thing just try this out.
Create a new project and add an MDI Form
Make Form1 an MDI Child
Add a text box to Form1
In the LostFocus Event of Textbox1 add this simple code:
Code:
If Text1.Text = "" Then Text1.Text = "0"
Now all you have to do is add a menu to MDIForm1
Have the menu item do whatever you want....then run the program.
Give Text1 the focus then click on the menu in the MDIForm1.
You will notice that the value of text1.text is not "0" as it should be.....this is my problem. I need the LostFocus even to process and by clicking on the menu in MDIForm1 this does not happen.
Hope you can help...thanks
-
May 15th, 2000, 04:09 AM
#6
Lively Member
:)
You need to do this...
form1.text = 0
since your giving focus to the other form its looking for a textbox on the midi form...
Private Sub Form_Load()
MDIForm1.Show
End Sub
Private Sub Text1_LostFocus()
MDIForm1.Show
If Form1.Text1.Text = "" Then Form1.Text1.Text = "0"
End Sub
Try this and let me know if this is what you need.
-------------------------
There is never only one right answer. That is the magic of programming.
-------------------------
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
|