Click here to Skip to main content
15,913,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: Generating listbox based on dataset? Pin
Heath Stewart5-Apr-04 17:20
protectorHeath Stewart5-Apr-04 17:20 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan5-Apr-04 18:27
MeterMan5-Apr-04 18:27 
GeneralRe: Generating listbox based on dataset? Pin
Heath Stewart5-Apr-04 18:34
protectorHeath Stewart5-Apr-04 18:34 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan5-Apr-04 21:14
MeterMan5-Apr-04 21:14 
GeneralChanging menu bars color Pin
MeterMan4-Apr-04 16:34
MeterMan4-Apr-04 16:34 
GeneralRe: Changing menu bars color Pin
Heath Stewart4-Apr-04 18:00
protectorHeath Stewart4-Apr-04 18:00 
GeneralRe: Changing menu bars color Pin
MeterMan4-Apr-04 19:09
MeterMan4-Apr-04 19:09 
GeneralMaking menu Item bring and kill focus Pin
MeterMan4-Apr-04 16:28
MeterMan4-Apr-04 16:28 
Ok let me explain what i'm trying to do first off
I have 1 form called form1 then i have 2 user controls add and delete.
I have a menu put on forms1 cause i'm using it as my main interface.
I have on the menu a item add record and then remove record.
when i hit the add record i want to bring to focus the add();
and the same thing for if i hit delete i want delete() to bringtofront.
But I don't want numerous instances of the same thing so how do i kill the instances based on the menu selection?

I never want form1 to be killed i just want it to loose its focus based on the menu selection.

So if i have in form1
private database.Add objSearch_notfound;
and under the addmenu

objSearch_notfound = new Add();
Controls.Add(objSearch_notfound);
objSearch_notfound.BringToFront();
objSearch_notfound.Show();

I understand this will bring the add to focus.
I also understand that
Controls.Remove(this);
this.hide();
if put on a button in the add() will kill the add() focus.

But how do i make it do this on the menu?
cause when i click the menu then the add() loses focus so if i did
addmenu()
controls.Remove(this);
this.hide();
it will kill the form1
I thought i could in form1 do this but it doesn't work
Controls.Remove(objsearch_notfound)
objsearch_notfound.Hide();

any clues would be great and hope this is clear. It's kinda hard to explain without showing you the source code.


Win32newb
"Making windows programs worse than they already are"
GeneralRe: Making menu Item bring and kill focus Pin
Heath Stewart4-Apr-04 17:52
protectorHeath Stewart4-Apr-04 17:52 
GeneralRe: Making menu Item bring and kill focus Pin
MeterMan4-Apr-04 19:12
MeterMan4-Apr-04 19:12 
GeneralRe: Making menu Item bring and kill focus Pin
Heath Stewart4-Apr-04 19:18
protectorHeath Stewart4-Apr-04 19:18 
GeneralRe: Making menu Item bring and kill focus Pin
LongRange.Shooter5-Apr-04 9:18
LongRange.Shooter5-Apr-04 9:18 
GeneralShockwave Flash in Windows Application!! Pin
Imad_4u4-Apr-04 15:40
Imad_4u4-Apr-04 15:40 
GeneralRe: Shockwave Flash in Windows Application!! Pin
Heath Stewart4-Apr-04 17:45
protectorHeath Stewart4-Apr-04 17:45 
GeneralRe: Shockwave Flash in Windows Application!! Pin
Jeremy Kimball5-Apr-04 3:44
Jeremy Kimball5-Apr-04 3:44 
GeneralControl Windows Key on Keyboard Pin
Member 6910894-Apr-04 15:04
Member 6910894-Apr-04 15:04 
GeneralRe: Control Windows Key on Keyboard Pin
Heath Stewart4-Apr-04 17:39
protectorHeath Stewart4-Apr-04 17:39 
GeneralRe: Control Windows Key on Keyboard Pin
Member 6910895-Apr-04 7:13
Member 6910895-Apr-04 7:13 
GeneralStartUp Folder?! Pin
Morten Kristensen4-Apr-04 14:28
Morten Kristensen4-Apr-04 14:28 
GeneralRe: StartUp Folder?! Pin
Heath Stewart4-Apr-04 17:29
protectorHeath Stewart4-Apr-04 17:29 
GeneralRe: StartUp Folder?! Pin
Morten Kristensen5-Apr-04 0:28
Morten Kristensen5-Apr-04 0:28 
GeneralAutoScroll on tabpage and animated cursor Pin
Flack4-Apr-04 11:18
Flack4-Apr-04 11:18 
GeneralRe: AutoScroll on tabpage and animated cursor Pin
Heath Stewart4-Apr-04 12:59
protectorHeath Stewart4-Apr-04 12:59 
GeneralRe: AutoScroll on tabpage and animated cursor Pin
Flack4-Apr-04 17:38
Flack4-Apr-04 17:38 
GeneralRe: AutoScroll on tabpage and animated cursor Pin
Heath Stewart4-Apr-04 17:43
protectorHeath Stewart4-Apr-04 17:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.