Click here to Skip to main content
16,008,942 members
Home / Discussions / C#
   

C#

 
GeneralRe: TreeView problem Pin
Mazdak30-Mar-03 9:02
Mazdak30-Mar-03 9:02 
GeneralSending Keystrokes/Mouse Clicks Pin
CyberKewl29-Mar-03 22:08
CyberKewl29-Mar-03 22:08 
GeneralRe: Sending Keystrokes/Mouse Clicks Pin
Philip Fitzsimons31-Mar-03 3:26
Philip Fitzsimons31-Mar-03 3:26 
GeneralUsing COM Objects from C# Pin
Andrew Peace29-Mar-03 13:11
Andrew Peace29-Mar-03 13:11 
GeneralRe: Using COM Objects from C# Pin
Stephane Rodriguez.30-Mar-03 5:39
Stephane Rodriguez.30-Mar-03 5:39 
GeneralRe: Using COM Objects from C# Pin
Andrew Peace30-Mar-03 8:07
Andrew Peace30-Mar-03 8:07 
Questiondelegates=strong refs? Pin
Roger Alsing29-Mar-03 7:29
Roger Alsing29-Mar-03 7:29 
AnswerRe: delegates=strong refs? Pin
Chris Jobson30-Mar-03 5:16
Chris Jobson30-Mar-03 5:16 
I think the solution is that if your usercontrol hooks itself to the parent's events it should also unhook itself. If you remove the control from its parent the control will get a ParentChanged event and the Parent will now be null. For example, the following code within the user control seems to work:

private Control parent = null;
private MouseEventHandler meh = null;

private void UserControl1_ParentChanged(object sender, System.EventArgs e) {
// Unhook from previous parent (if any)
if (parent != null) {
parent.MouseMove -= meh;
}

// Remember new parent
parent = Parent;

// Hook new parent (if any)
if (parent != null) {
if (meh == null) meh = new MouseEventHandler(parent_MouseMove);
parent.MouseMove += meh;
}
}

Chris Jobson
GeneralListView to ListView == not so hot Pin
pimponya200029-Mar-03 5:47
pimponya200029-Mar-03 5:47 
GeneralIE-Com Problem Pin
Calamitous28-Mar-03 22:39
Calamitous28-Mar-03 22:39 
GeneralRe: IE-Com Problem Pin
Stephane Rodriguez.28-Mar-03 22:56
Stephane Rodriguez.28-Mar-03 22:56 
Generala problem about a setup project Pin
zamazula28-Mar-03 20:12
zamazula28-Mar-03 20:12 
GeneralDynamincially Adding Controls to a Win Form Pin
siqbal28-Mar-03 12:30
siqbal28-Mar-03 12:30 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone28-Mar-03 13:36
sitebuilderDavid Stone28-Mar-03 13:36 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
Stephane Rodriguez.28-Mar-03 20:27
Stephane Rodriguez.28-Mar-03 20:27 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone29-Mar-03 6:23
sitebuilderDavid Stone29-Mar-03 6:23 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
siqbal29-Mar-03 13:41
siqbal29-Mar-03 13:41 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
David Stone29-Mar-03 16:59
sitebuilderDavid Stone29-Mar-03 16:59 
GeneralRe: Dynamincially Adding Controls to a Win Form Pin
Stephane Rodriguez.30-Mar-03 5:42
Stephane Rodriguez.30-Mar-03 5:42 
GeneralInt textBox Pin
blink4me28-Mar-03 9:32
blink4me28-Mar-03 9:32 
GeneralRe: Int textBox Pin
Andreas Philipson29-Mar-03 2:51
Andreas Philipson29-Mar-03 2:51 
GeneralRe: Int textBox Pin
blink4me29-Mar-03 4:59
blink4me29-Mar-03 4:59 
GeneralMime parsing algorithm suggestions requested Pin
Member 9628-Mar-03 8:52
Member 9628-Mar-03 8:52 
GeneralRe: Mime parsing algorithm suggestions requested Pin
leppie28-Mar-03 11:53
leppie28-Mar-03 11:53 
GeneralRe: Mime parsing algorithm suggestions requested Pin
Member 9628-Mar-03 12:12
Member 9628-Mar-03 12:12 

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.