I have built a form in which the user can view multiple rows of data pulled from a table. The user has the option to select a row, then pressing a button to reject the data in that row, (to be marked as rejected in some STATUS field).
I have also designed a rejection confirmation dialog with the ability for the user to enter some comments or reason for rejection.
I have set up the dialog canvas to appear on its own window with the Type proeperty set to Dialog.
When the user selects a row to reject, here is the code that gets executed:
BEGIN
GO_BLOCK('BLK_ALL_RECORDS');
FIRST_RECORD;
IF :FRM_ALL_ROWS.CHK_SELECT = 1 THEN
:FRM_REJECTION.ID := :FRM_ALL_ROWS.ID;
GO_BLOCK('BLK_REJECTION');
SHOW_VIEW('CNV_REJECTION');
EXIT;
ELSE
NEXT_RECORD;
END IF;
END;
And the rejection form has two buttons, one to confirm and one to cancel. Let's just focus on the cancel button for now. Here is the code that is executed once the Cancel button is pressed:
:BLK_ALL_ROWS.CHK_SELECT := 0; /* Forces removal of the check mark */
GO_BLOCK('BLK_ALL_RECORDS');
HIDE_VIEW('CNV_REJECTION');
The only problem is : once the dialog form appears, it hides the parent form, until the form is dismissed. How can display the dialog form ontop of the parent form with both of them visible (in a modal way?)
The navigation between different canvases can be little bit tricky to get to work. Hard to say what is the problem with not having the form in front of me but the first thing I should do is making sure that the 'Raise on entry' canvas property of the 'main' canvas is set to 'Yes'. This should force this canvas to be displayed when you are moving the cursor back to block 'BLK_ALL_RECORDS'.
Another alternative could be to use SHOW_VIEW() in the cancel dialog logic to force the main canvas to be displayed.
I found out what was the problem finally.
The parent Window had a property [Hide On Exit] which is defaulted to Yes and that made the parent form disappear everytime another window is on display. I set it to NO and called the other form. This time both windows are visible, with the modal one always on top.
Related
I have a main form...imagine that...that for most of my users will be the only form they use. Naturally, it contains tabs with sub forms.
I have a navigation sub form on the left side of this form that changes based on the user's rights level. Currently, this sub form is all buttons...and 1 always is selected as the default tab stop for that form.
I don't want to highlight any of them at first...and I can remove the highlight by switching off Tab Stops for all buttons. However, I'm not sure that I want to remove that functionality all together...and it still highlights a button. I'd just like for there to not be a default button highlighted.
As you can see, Add Course is 'selected'. I can't seem to find the correct terminology to search for a way to do this. I tried using a smaller button set behind another button, but since it has the focus, it moves to the front. Using a text field with the same colors as the background shows the cursor in a random, blank area...not visually ideal.
I'm sure that there is someone here clever enough to have this figured out. Please enlighten me. I don't care if this can be handled in VBA code or through design view.
"Focus" is the word you're looking for - you don't want any visible control to have the focus when opening the form.
The easiest method is an invisible button: create a button with Transparent = True, and an empty OnClick (i.e. the button does nothing, even when accidentally clicked).
Move this button to the top in the Tab Order, so it has the focus when opening the form.
But if your users use TAB to walk through the buttons, there will be one position where the focus disappears (when circling around from the last to first control). I don't know if it will confuse them.
Create a button on the main form itself.
Named is cmdDummyButton with the following GotFocus event code.
Set the tab order property to 0 (ie first)
Make the button transparent.
This will cause no control on the form to have the focus when it starts up.
Private Sub cmdDummyButton_GotFocus()
Static IveHadFocusAlready As Boolean
If Not IveHadFocusAlready Then
Me.cmdDummyButton.Enabled = False
IveHadFocusAlready = True
End If
End Sub
Sweet.
I have a MS ACCESS 2007 form with 2 subforms. I have a few fields from the main form as text, a few on the second form as text, and a lot on the third form as a variety of things.
My problem with these subforms, when I am entering data in the main form, my mouse scroll works just fine to scroll to the bottom of the form. When I am in subform 1 or 2, my mouse scroll stops working to scroll down to the bottom of the main form. I tried looking up disabling mouse scrolling but that's already preset for a single form view in MS Access 2007. I just want the mouse scroll to work only for the general form even if you are doing data entry into subform 1 and 2.
I know it's been a while since your post. But I've had nearly the same problem and figured it out, so thought I'd post the answer anyway:
If you make an extra textbox in your main form (make sure it's property visible is set to TRUE), then place this textbox behind any other control so to the user it seems like there is no textbox.
Now in the properties of the details selection of the mainform make an onClick event (this occures when you click anywhere in the mainform). In this event use the SetFocus method which redirects to the textbox made earlier. The code looks like this:
[Forms]![MAINFORM]!TEXTBOX.SetFocus
If you click on the form (outside the subforms) the textbox gets selected automatically, which allows you to scroll the main form. The user doesn't see the textbox so it seems as if he/she selected the mainform.
Hope it helped!
In my JavaFX application I want to pop up some dialog box (as confirmation box).
But I do not want to make chance user to skip that one.
That mean in many examples I have seen once Dialog Box is popup user can click out of that and can skipped it, then that dialog box is remains as it is ever.
Thanks.
To make a dialog modal (i.e. block input to other application windows), call on the dialog stage:
dialogStage.initModality(Modality.APPLICATION_MODAL)
Defines a modal window that blocks events from being delivered to any other application window.
OR
dialogStage.initModality(Modality.WINDOW_MODAL)
Defines a modal window that block events from being delivered to its entire owner window hierarchy. Note: A Stage with modality set to WINDOW_MODAL, but its owner is null, is treated as if its modality is set to NONE.
I'm trying to build a Wizard framework in Windows Forms. I've managed to glean a lot of useful tips from this and other sites which have gotten me very close to success. However, I'm having a problem with displaying an ErrorProvider on any tab page other than the first page of the wizard.
My Wizard control is a UserControl. It contains a custom tab control that I've derived from TabControl so that I can hide tabs and ignore attempts to navigate between tabs using keypresses, along with the usual collection of Back/Next/Finish/Cancel buttons at the bottom of the control.
I've used reflection to allow me to raise the validation events on a particular TabPage that belongs to the Wizard Control when I hit the Next button. (I don't want to validate the whole TabControl, only the currently active page.) When I do this, I see in the debugger that my Validating routine for the controls on the current tab page is correctly called and I see that I've called the ErrorProvider that I've attached to the particular control (a TextBox in this case) with a valid error message. I set Cancel to true for the CancelEventArgs in the validating routine and that's picked up by the code that uses the reflection mechanism so that I see that I've failed and don't change tabs. And I set the focus successfully to the control that failed validation.
So all that appears to be working just fine.
Unfortunately, I don't see the ErrorProvider's cheery blinking icon unless I'm on the first tab page. For all of the other tab pages, there's no message visible at all.
I'm baffled. Any thoughts? I can provide code snippets, if helpful.
Thanks!
I assume that in your case the button that moves to the next step of the wizard is placed outside (below) the TabControl
I noticed that the icon is displayed correctly if I pressed the button without releasing the mouse button. It seems that the button outside the container gets focused event though a validation error has occurred (normally you would not be able to leave the active control).
I worked around this issue by registering an event handler for the buttons MouseUp event to "refocus" the TabControl:
private void cmdOK_MouseUp(object sender, MouseEventArgs e)
{
tabControl1.Focus();
}
Note: you also need to set your forms ActiveControl property the one of the controls that failed validation.
Here is what I want to do.
Is there a way I can throw a temporary alert which fades away in 4 sec so user knows he has clicked the button and the results are getting generated.
Why all this:
When user clicks a button, I retrieve id's of checked rows and build a dynamic html table to display the results in a showmodal dialog window.each row in seperate divs.
Why I used setTimeout:
I noticed that the showmodal dialog would appear before the html was built resulting at times with an empty page. So to give my dynamic html time to build I call the setTimeout function to call another function "setTimeout('CallModFunction()',4000);" and within this I call the showmodal dialog, so the html displays perfectly on the dialog window.
My question is:
Is there a way I can throw a temporary alert which fades away in 4 sec so user knows he has clicked the button and the results are getting generated.
Check out Noty: http://needim.github.com/noty/