|
-
May 8th, 2003, 06:40 AM
#1
Thread Starter
Lively Member
2 simple questions but still unsolved.
Question 1 : how do we open mdi child forms like modal ones ?
besides opening forms from the menu... there are some dialog box kind of forms.. which should be closed before returning back to its parent form... but it seems there is some problem in showing mdichild as modal... how do i solve it ??
Question 2 : formatting numbers in textbox ?
formatting numbers on lostfocus works.
but i want that whenever any text appears in that textbox..
it should appear formatted. means i need not lost focus it to make it to correct format.
-
May 8th, 2003, 07:16 AM
#2
Fanatic Member
MDI children cannot be shown modally, this is what happens when you try:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dll
Additional information: Forms that are not top level forms cannot be displayed as a modal dialog. Remove the form from any parent form before calling showDialog.
For #2 you could try using TextChanged, although if you change the text on a textchanged event (e.g. formatting) this will make the event handler trigger itself (bad).
-
May 8th, 2003, 09:17 AM
#3
Frenzied Member
For question 2:
You may try to format it on Textbox_Leave event and if not correct format return the focus to that.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
May 9th, 2003, 03:43 AM
#4
Thread Starter
Lively Member
what if..
the textbox is disabled...
i want that whenever any number appears it that it should be formatted only...
i need not leave the textbox for bringing it to correct format.
-
May 9th, 2003, 08:41 PM
#5
Fanatic Member
If it's disabled, then format the text before you assign it to TextBox.Text.
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemStringClassFormatTopic.htm
Rather than any event code for the textbox itself (if it's disabled there really shouldn't need to be any) put the formatting in whatever code actually sticks the value into the textbox.
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
|