Disabling A Control When A Modal Form Is In Focus?
I made an Active X control that loads in IE and calls separate forms for entering information. The problem is that when the form is in focus, you can still click on anything on the control on the IE window and mess things up like open up a form that's already open.
Does anyone have any ideas? Thanks!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Modal Form Without Focus
How can I make a form modal but give the focus to the parent window.
Like the search window in VB.
mfG Flo
Old Problem, Still No Solution? (modal Form Losing Focus When Parent Form Is Minimize
Hi everyone,
I have a problem with modal forms that's very easy to reproduce, and
practically locks up the application:
When closing Form1 I display a modal from (Form2), more or less to
request
the user if he's sure, etc. That works fine if Form1 is in normal
window
state and visible.
If I minimize Form1 in the windows Taskbar before closing it using the
system menu, Form2 appears, but is grayed and cannot receive mouse or
keyboard input. Because Form2 is displayed and modal, I cannot do
anything
else with the application. As far as the user is concerned, it's dead
and
frozen.
Form2 does not receive a Deactivate or LostFocus event, where I could
possible "repair" things.
Cheers, Marek
Runtime Error 401 Can't Show Non-modal Form When Modal Form Is Displayed
Hey guys !
I am going crazy due to this (Runtime Error 401 Can't show non-modal form when modal form is displayed)
This error doesn't occur while I test the software in the VB run mode... only when i run the exe !
Any ideas why this is happening ?
chao
Edited by - pingu2k on 2/20/2007 6:00:02 AM
How Do You Reference Control Objects From A Modal Form ?
Hi
I'd like to know what the syntax is for referencing a textbox on my activex
control from a modal form that is launched by the control. i.e. I have a
popup form where you make a selection from a listbox and click on OK, the
selected value must then be written to a field on the usercontrol.
PLEASE NOTE: I'm trying to write a value from the form to the control and not the other way round.
Thanks
Uthmaan
Can't Show Non-modal Form When Modal Form Is Displayed??? Only When Burned On Cd
Hello guys, i have this problem:
When i burn my program on cd and try to run it i get this error: Can't show non-modal form when modal form is displayed
then if i click OK another error: unable to find d: extfile.txt even if the drive where the cd is e:
to open the txt file i use this code:
Open App.Path & "ookmarks.txt" For Input As #1
any suggestion???
thanks in advance
ah... when executed from hard disk everything works fine
Disabling All Form's Control Or The Form Upon Opening The Form.
Hi There
Here is my Objective (What I want to accomploish).
Upon opening a Form Called “Search”, the Curser gets focused on a ComboBox called “comboTrans”, And the user must select a value form the ComboBox before they are allowed to move to any other Control. (That is all)
Off Course since the form is an Unbound, They should be able to close the Form any time they wish, Even thou, they have not selected any value from the ComboBox “comboTrans” yet.
I tried many different events of The control and the form itself.
The closest that I came to reach the above objective was in Lostfocus Event of the control itself, But It causes problem when the user decides to close the Form before entering any values ‘for any reason”, the Control’s msgBox Keeps Popping Up.
Therefore I decided a different technique;
And that is Upon Opening the Form, Basically disable or Lock all the controls in the above Form or the Form itself, Except the ComboBox. Then setting the focus on the Active ComboBox, and Even if the User moves to other control, with the help of a MsgBox Forcing the user to move back and select a value from the Active ComboBox
And in the AfterUpdate event of the ComboBox make all other controls Enabled or active again.
A note the form has No record Source and the Control itself is unbound and has No Control Source.
Best Regards
Sanan
Edited by - sanan on 1/6/2005 7:25:56 AM
Converting A Modal Form To Non-Modal And Vice Versa
Hi 2 All,
I am facing a very peculiar problem. I have one application which shows one form as modal. Then that form is calling a method in an referenced component and that intern shows another form as modal. Unfortunately, two modal forms can be displayed one top of the other. How do handle this?
Expecting experts to drop few lines.
Nazim.
Show &"Waiting&" Form (Non Modal) When Click On Button From Modal Form
Hi,
I have a modal form with a button. When I click on this button, it take a long time because it's doing a SQL query. During that time, I would like to show a form with a message on it to let the user know that it taking some time.
As the first form is modal (and it should be modal), I can't show the second form non modal (form2.show generate an error 401, because the first form is modal form.show 1).
If the second form is modal, it's doesn't show until the form load is fiinished. But I WANT that the form2 is shown in first and after proceed with some code in the form1.
How can I resolve my problem?
Thanks
Dominic Lavoie
City of Laval
Quebec, Canada
Can't Show Non-modal Form When Modal Form Is Displayed
Within a timer, I tried to display a modal form but there is not any non-modal form that is going to be displayed. But I got this error "Can't show non-modal form when modal form is displayed". Any guru here can explain to me what might cause this problem. Thanks for your inputs!
&"Can't Show Non-modal Form When Modal Form Is Displayed&" Error!
Ok, I'm coding a game in VB6, and I have a slight error with the hall of fame...
When the program is ran in VB6 (Not Compiled), this problem doesnt happen. When compiled, is when the error occurs.
Here is the story...
You can acess the hall of fame two ways. One being from the main menu, the other being from when you die in the main game.
When acsessed from the main menu...
http://www.freewebs.com/vagjd/prob1.JPG
It works fine. It sorts the sequential files from highest to lowest, it works perfectly.
http://www.freewebs.com/vagjd/prob2.JPG
When acsessed from the game, when you get game over...
http://www.freewebs.com/vagjd/prob3.JPG
It gives this strange error...
http://www.freewebs.com/vagjd/prob4.JPG
.
.
.
.
Also, I'd like to note that when games is equal to false (User is acsessing the hall of fame from the main menu) is when the hall of fame works.
Quote:
Dim nmes(6) As String, times(6) As Variant, ttemp As Variant, ntemp As String, uname As String
'***note***, the variable games is globaled in a module, and
'is used to determine weather the user acsessed the hall of fame from the
'user losing in the game, or the user selecting hall of fame from the main
'menu
Private Sub cmdone_Click()
HallofFame.Hide
Menu.Show
End Sub
Private Sub Form_Activate()
If games = True Then
soundcheck = 1
Intro2.Show
Intro2.Hide
uname = InputBox("Please enter your name", "High Score Listing")
If uname = "" Then
uname = "Unnamed"
End If
End If
'Easy Settings
If opts(1) = 0 Then
lbltitle.Caption = " Hall of Fame Easy"
If games = True Then
'adds the new time to the file
Open App.Path + "ehighscore.txt" For Append As #1
Write #1, uname, thetime
Close #1
End If
Open App.Path + "ehighscore.txt" For Input As #1
x = 1
For x = 1 To 6
nmes(x) = ""
times(x) = ""
Next x
If games = True Then
For x = 1 To 6
Input #1, nmes(x), times(x)
Next x
Else
For x = 1 To 5
Input #1, nmes(x), times(x)
Next x
End If
End If
'Normal settings
If opts(1) = 1 Then
lbltitle.Caption = " Hall of Fame Normal"
If games = True Then
Open App.Path + "
highscore.txt" For Append As #1
Write #1, uname, thetime
Close #1
End If
Open App.Path + "
highscore.txt" For Input As #1
x = 1
For x = 1 To 6
nmes(x) = ""
times(x) = ""
Next x
If games = True Then
For x = 1 To 6
Input #1, nmes(x), times(x)
Next x
Else
For x = 1 To 5
Input #1, nmes(x), times(x)
Next x
End If
End If
'Hard Settings
If opts(1) = 2 Then
lbltitle.Caption = " Hall of Fame Hard"
If games = True Then
Open App.Path + "hhighscore.txt" For Append As #1
Write #1, uname, thetime
Close #1
End If
Open App.Path + "hhighscore.txt" For Input As #1
x = 1
For x = 1 To 6
nmes(x) = ""
times(x) = ""
Next x
If games = True Then
For x = 1 To 6
Input #1, nmes(x), times(x)
Next x
Else
For x = 1 To 5
Input #1, nmes(x), times(x)
Next x
End If
End If
Close #1
'Sorting Process
'If loaded after playing the game
If games = True Then
For y = 1 To 5
For x = 1 To 5
If times(x) < times(x + 1) Then
ttemp = times(x)
times(x) = times(x + 1)
times(x + 1) = ttemp
ntemp = nmes(x)
nmes(x) = nmes(x + 1)
nmes(x + 1) = ntemp
End If
Next x
Next y
'if loaded from the menu
Else
For y = 1 To 4
For x = 1 To 4
If times(x) < times(x + 1) Then
ttemp = times(x)
times(x) = times(x + 1)
times(x + 1) = ttemp
ntemp = nmes(x)
nmes(x) = nmes(x + 1)
nmes(x + 1) = ntemp
End If
Next x
Next y
End If
For x = 0 To 4
lblname(x).Caption = nmes(x + 1)
lbltime(x).Caption = times(x + 1)
Next x
'Writes the new highscore list to the file.
If opts(1) = 0 Then
If games = True Then
Open App.Path + "ehighscore.txt" For Output As #1
For x = 1 To 5
Write #1, nmes(x), times(x)
Next x
Close #1
End If
games = False
ElseIf opts(1) = 1 Then
If games = True Then
Open App.Path + "
highscore.txt" For Output As #1
For x = 1 To 5
Write #1, nmes(x), times(x)
Next x
Close #1
End If
games = False
ElseIf opts(1) = 0 Then
If games = True Then
Open App.Path + "ehighscore.txt" For Output As #1
For x = 1 To 5
Write #1, nmes(x), times(x)
Next x
Close #1
End If
games = False
ElseIf opts(1) = 2 Then
If games = True Then
Open App.Path + "hhighscore.txt" For Output As #1
For x = 1 To 5
Write #1, nmes(x), times(x)
Next x
Close #1
End If
games = False
End If
End Sub
Private Sub Form_GotFocus()
cmddone.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Menu
Unload Intro2
Unload Instre
End Sub
.
.
.
.
Thanks in advance
Modeless Vs. Modal And Focus Issues
One of my users has noticed this and I didn't know this was an issue. The form I created (VBA) is a rather large form, which they have no problem with. When they need to get customer information, they usually ALT-TAB to get to the customer information screen and jump back to the application to copy it down. This is very time consuming as everytime the user does an ALT-TAB, the control that last had the focus loses that focus. The issue is that when they ALT-TAB back to the form, the focus is on the form, not the control last selected. The issue only surfaces when the form is modeless. My application requires a modeless form, so I cannot simply just keep it modal. Is there a built in feature in VBA to save the last known focus? GetFocus and LostFocus don't exist in VBA, as far as I've seen.
Set Focus To A Text Box In Modal Dialog
I have a modal dialog that has only one text box for a user to enter data into. I want to set focus to that text box so the user doesn't have to click inside the box to enter in the data. Currently I have the following code:
Load dialog
dialog.txtBox.SetFocus
dialog.Show 1
the interpreter complains about the SetFocus call. ???
I did set the txtBox tab stop to be a '1' and that appears to have fixed my problem, but I was just wondering if this was the correct solution. Or will this solution always work?
Scott
Form Focus And Control
I have a program that runs int the backround and opens a form whenever a specified program starts. What I need to know is how do I make it so when the form comes up it come up in focus and cannot lose focus to other external programs or windows.
Disabling Textbox Focus.
We have a need to keep users from clicking into a textbox.
Its a multiline textbox control, and the user still needs to be able to use the scroll bar, so setting its enabled property to false wont work.
Basically, we need the user to be able to use the scrollbar in the textbox, but not be able to change any text in the text box, and if possible, prevent them from even getting a cursor in the textbox.
Any suggestions?
Disabling Textbox Focus
Hello,
Is there any way to disable focus of a textbox (for example, if the user clicks the textbox, the blinking text curser won't appear)? I want the textbox to look like it's there but act like it's just a piece of the background until the user performs a particular action.
Thanks in advance,
Mike
Form Focus (Window Control)
Ok, so this time im trying to detect which window is currently in focus. I have this little tooltip type window that pops up when you click a textbox, its called frmDescPresets. The form that it pops up from is called frmNewProp.
What i want to have happen is when the person clicks the textbox, then frmDescPresets pops up right below the textbox (which works great), and whether your typing in the box or trying to select an item from the popup window, it will stay there. But if you click out of the window to select another window in windows, not just the program, then that box will dissapear. The reason i want this is because im using API to make sure that window is always on top, that way you can type in the text box without the window dissapearing.
So as long as that text box or frmDescPresets has focus, then frmDescPresets will stay, but once they both lose focus, or another window outside of the program gains focus, then the box will go away..
i was gonna post a thread i was looking in but i ended up copying some code to my clipboard before being able to post here Oh well
Anyone know how to do this?
Making Modal Form Truly Modal
I'm working in VB3 (I know!) but I think this applies to other versions of VB as well...
I have an MDI form which sometimes pops up modal non-MDI forms. When this happens, if the user gives focus to another application and then clicks on the icon of the MDI form, no action is permitted on the MDI form since another modal form is currently open.
What I need to know is how I can code/configure the program such that if the MDI form is selected from the taskbar when a modal form is opened, that the modal form is brought into focus on top of the MDI form.
This is donde in programs such as Word 97.
Thank you,
Craig Steiner
Open Non Modal Form From A Modal
Hi,
I need to open a non modal form from a modal one.
If i use the function "Show", it gives an error that it cannt be done.
Do u know a way to do it?
Thanks in advance
Displaying A Non Modal Form On Top Of A Modal Form?
Forgive me if this is a dumb question. My searches turned up little.
What I need to do is display a form asking the user to stand by. This happens when they bring up a modal form from the main app (so three total forms). The 3rd form asking the user to stand by needs to be non modal since the 2nd form needs to do some lengthy communication processing. Of course, VB wont allow a non modal form to display when a modal form is already displayed... I cant just bring up the 3rd form first because the second form will periodically refresh the communication processing (at which time the wait message needs to be displayed again).
Anyone have a way of doing this? What am I missing??
URGENT - Need To Trap When Control On A UserControl On An MDI Form Loses Focus
I am writing a UserControl, which I then have put on another UserControl which is being displayed in a third party applications MDI Form
My problem is that I have a customdrawn dropdown on my first UserControl.
When the dropdown is open and the user clicks elsewhere in the third part application or even outside the application, the MyDropDown_LostFocus event is not called.
I need to capture this event to perform a close the dropdown.
I have tried setting CausesValidation on the MyDropDown and using the MyDropDown_Validation event, but this is not fired in these circumstances either.
Any Ideas.
Modal/Non-Modal Form
When I run my code from VB I don't get this problem, but when I try to run the .exe I get an error that says "Can't show non modal form when modal form is displayed". I don't have anything set to non modal or modal. Can anyone help me?
Thanks!
How To Give Focus To Activex Component On Form Focus?
Using the Reflections ActiveX component (Reflections is a popular Terminal Editor for connecting with old Alpha/VMS servers), I have a Form with this internal terminal editor ActiveX that obviously needs to have focus to type in.
I've tried setting Form_GotFocus and Form_Click to give focus to the activex component but to no avail. The only thing that works is if I set Form_Repaint to give focus, then it works fine. But repaint causes the window to constantly try to bring itself in front of other Microsoft apps like Word and Outlook and other VB apps when I drag them in front of it. And it keeps flashing in the task bar when I move something non-MS in front of it.
Is there a better way to keep focus on the activex terminal session when the form gets focus without using repaint?
Normal Form And Dialog / Modal Form Sharing A Taskbar Item
My situation is I have a normal form (aka not a modal form), and a modal form that serves as an about window. When you show the modal form, all the items in the task bar lose focus. If you switch windows, and then go back to the 1 taskbar item for my program, again the taskbar item for my application loses focus and no taskbar item has focus.
I'm trying to make my application do the same thing as Word (for example). If you show the About window, the About window always has focus until you close it, but both the application window and the about form "share" the taskbar item, so when you click on Word in the taskbar, it doesn't lose focus.
Is this possible in Visual Basic 6?
Thanks in advance,
L. Whiteside
Block Form From Loading If Another Specific Modal Form Is Loaded [RE-SOLVED]
How can I block a Form from loading when another Form is loaded as Modal? The second Form is loading automaticaly if there is an error to report but if the Modal form is Loaded it's causing an error.
How can the program know that the first modal Form is Loaded before loading the second?
I've tried several approaches but non seem to work....
Thanks
_________________________________________________________________
Edited by - vbprog1144 on 8/7/2005 6:31:26 AM
How To Change Properties Of The Parent Form From A Modal Child Form, Plz?
I want to open a child form windows (frmPortSetting) and from there changing some ActiveX components properties (comTx) which are on my parent form (frmMain).
I wrote code in frmPortSetting sub procedure but it seems that I can't change comTx properties directly there. (e.g. comTx.settings(9600,n,8,1)) Any advise please?
How To Change Properties Of The Parent Form From A Modal Child Form, Plz?
I want to open a child form windows (frmPortSetting) and from there changing some ActiveX components properties (comTx) which are on my parent form (frmMain).
I wrote code in frmPortSetting sub procedure but it seems that I can't change comTx properties directly there. (e.g. comTx.settings(9600,n,8,1)) Any advise please?
Form Got Focus Or Lost Focus Don't Work
Hi, I have a form that I can't get the Lost Focus or Got Focus events to fire, would anybody know why?
Here is what I am trying to accomplish. I have an .exe vb6 application(MainApp) that opens another .exe vb6(ChildApp) application using the shell command. The main application has a list view with a bunch of records. The ChildApp is used to Insert, Delete or UPdate records from the MainApp. So when an Insert, Update or Delete take place on the Child App, I'd like to refresh the listview on the MainApp because the records have changed. How can I accomplish this? Is there a way to call the form in the Main Application from the Child Application even they are 2 different .exe files? I really need help on this please.
Calling A Modeless Form From A Modal Form
how can I do this? I saw something in MSDN about calling it as a child, but I tried
Code:
no.show (vbmodal,lissel)
'no is the name of the modeless form and lissel be the
'parent, the modal
argh...thanks for the help!
Get The Parent/Owner Form Of A Modal Form
Does any one know how to get the Parent or OwnerForm of a Modal Form?
I am using the Forms collection to unload all forms in application exit.
vb Code:
For Each frm In Forms If frm.name <> CurrentForm.name Then Unload frm Set frm = Nothing End If Next frm
But this hangs when the current form is a modal Form (the Login Form) showed uppon another form. The reason (as I guess) is that above code is trying to unload the Parent of the current form which wont unload until this current form is unloaded. If that is so,it'd create a dead lock situation.
And I call this code in QueryUnload. So is there any method to get the name of the modal Form's parent ?
Thanks In Advance
Showing A Topmost Form From A Modal Form
Does anyone know how to show a topmost form from a modal form?
The effect I wish to achieve is a floating toolwindow over a modal form.
I am using the SetWindowPos() api to make the child form topmost ie floating. This works fine when the parent calling form is itself is shown non-modal. However when the parent form is shown modally I get a stack overflow error and a GPF.
Any help much appreciated,
Avinder Bahra
Avinder Singh Bahra
Refresh A Form Not In Focus From A Form That Is In Focus
When in a program with mulitple forms, I would like to refresh a form that is not currently in focus from a form that is currently in focus.
I have a parent form that contains status information. I call a child form to change information that will affect the satus information display.
Currently I go back to the parent that was not in focus, and perform and perform a manual refresh, via a command button which changes the entries in the status line.
All variables in a common module and declared as public.
What instruction process can I use to change information on the parent form when changes are made on the child form.
Disabling Buttons On MDI Form From A Child Form
I would like to disable the toolbar buttons on the MDI form from a child form
I write:
frmMDI.tbtoolbar.buttons(2).enabled = false
from the MDI child but I get an error
"Only one MDI form allowed"
Does anyone know how to do this?
Disabling Buttons On MDI Form From A Child Form
I would like to disable the toolbar buttons on the MDI form from a child form
I write:
frmMDI.tbtoolbar.buttons(2).enabled = false
from the MDI child but I get an error
"Only one MDI form allowed"
Does anyone know how to do this?
Modal Form
Hi,
I want the form to be loaded modally without using vbModal property. ie
When the form is loaded, form should act as modal form not using the property for that. Can anyone help in this?
Modal Form
I have created a class that does some processing via loops. To improve the user interface I have added a form with a progress bar so that the user can the see the application is doing something and has not crashed. The problem is that I want to make the form modal so the user can't do anything while processing occurs. However if I call the progress form using vbModal execution of the code pauses until the form is unloaded. Does anybody have any suggestions on how I could get around this?
Modal Form - Help
Hi!
I want to timeout the user from an application after MAX_TIME.
I want to unload the main form when MAX_TIME has reached. But I want to leave a msgbox to the user with a message "Your application has been timed out".
How can I unload the form and still leave a msgbox open. Could somebody please help.
The below code doesnot work because, it unloads the form and never throws the message.
Unload frmCIRMS
MsgBox (" Your Application session has been timed out.")
If i move the msgbox above "Unload frmCIRMS",
it will wait for the user feedback before it timesout. I want to exit main form without waiting for the user feedback.
Thank you for your time
Modal Form
Hi
I have a MDI form where i want to display a mdi child. but i want this child to behave like 'modal()' so the user can't get out the form when it is not completed correctly.
Edited:
When i import a dialog and show it after pressing a menu item in the mdi parent ... then the dialog is shown when i minimaze the mdi parent.
What's the problem here? :s
And another little thing
I dont' seem to find a method for deleting an entry in the listbox :x
You guys can help?
Greetings
Jens
Modal Form In MDI
Hi All,
My application is an MDI, i am trying to lock the system in a particular time if my system is Idle..Am using a Modal Form to get the password and open the system...
My problem is if the application is idle in minimized state,the password form appers outside the MDI application since it is not a child form(as it cannot be showed modally)...
Plz help me to overcome this.....
|