|
-
Aug 13th, 2007, 11:03 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED][02/03] How to make the focus on activated form only
Hi All ,
I describe clearly within the content of thread, Hope u all understand my problem because my english is bad.
When user open a form within the program, the user only can do action on activated form except others program. Seem like the address book in Windows XP. When u click new contact, u must completely fill up the form before u go back to parent form unless u close it without modification.
Thanks for help me :-)
Last edited by nUflAvOrS; Aug 14th, 2007 at 08:37 PM.
Reason: RESOLVED
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Aug 14th, 2007, 03:37 AM
#2
Hyperactive Member
Re: [02/03] How to make the focus on activated form only
Use 'ShowDialog' to show your new form, that way focus will remain on the new form until it's closed
If my post helps , please feel free to rate it 
-
Aug 14th, 2007, 07:10 PM
#3
Thread Starter
Hyperactive Member
Re: [02/03] How to make the focus on activated form only
Thanks your help !!
However, when i used showdialog(), that is not exactly i want because when i activate the childform with showdialog instead of .show, the form do not belong to childform anymore.
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Aug 14th, 2007, 07:29 PM
#4
Re: [02/03] How to make the focus on activated form only
Are you saying (without actually saying it) that you want this second form to be an MDI child of the first? If so then what you're asking for is not possible. You cannot prevent access to the parent because the child form is actually a child control of the parent. You can prevent access to the other controls without preventing access to the child form too, unless you individually disable each of the other controls.
-
Aug 14th, 2007, 07:30 PM
#5
Frenzied Member
Re: [02/03] How to make the focus on activated form only
Do something like validate all of the entries.
If not of all of the entries are acceptable, cancel the form closing event and ask the user if they want to abort the entries entirely or just continue with making corrections to the entries.
-
Aug 14th, 2007, 08:03 PM
#6
Thread Starter
Hyperactive Member
Re: [02/03] How to make the focus on activated form only
Thanks ya ...
Code:
If Not IsNothing(frmadd) Then
If Not frmadd.IsDisposed Then
frmadd.BringToFront()
Else
frmadd = New frmAdd
frmadd.lblForm.Text = "Add New Machine Type"
frmadd.lvlItem.Columns.Add("Machine Type", frmadd.lvlItem.Width - 10, HorizontalAlignment.Left)
frmadd.ShowDialog()
frmadd.BringToFront()
End If
Else
frmadd = New frmAdd
frmadd.lblForm.Text = "Add New Machine Type"
frmadd.lvlItem.Columns.Add("Machine Type", frmadd.lvlItem.Width - 10, HorizontalAlignment.Left)
frmadd.ShowDialog()
frmadd.BringToFront()
End If
frmadd.MdiParent = Me.MdiParent
frmadd.Dock = DockStyle.Top

The area i mark with circle show that when i open a new Childform.by using .showdialog() it is the way i want, the problem is it will open up a new icon in window panel.However, it would not create a new icon in window panel by using .show() method but it is not the way i want.
hmm~~ Sorry, how to stop the form_closing event ?
Last edited by nUflAvOrS; Aug 14th, 2007 at 08:08 PM.
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Aug 14th, 2007, 08:28 PM
#7
Re: [02/03] How to make the focus on activated form only
Just set the form's ShowInTaskbar property to False, which is what you should be doing for all modal dialogues.
-
Aug 14th, 2007, 08:37 PM
#8
Thread Starter
Hyperactive Member
Re: [02/03] How to make the focus on activated form only
Opsss ! thanks Jmcilhinney .. U r kind ....hahah ..
Thanks others ppl opinion.. thanks a lot..
I appreciate the help from you all :-)
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
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
|