Click here to Skip to main content
15,898,787 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows Forms Pin
pahlsson13-May-03 22:39
pahlsson13-May-03 22:39 
QuestionHow to get screen area Pin
J. Dunlap13-May-03 9:24
J. Dunlap13-May-03 9:24 
AnswerRe: How to get screen area Pin
leppie13-May-03 11:49
leppie13-May-03 11:49 
GeneralRe: How to get screen area Pin
J. Dunlap13-May-03 18:17
J. Dunlap13-May-03 18:17 
QuestionFind the namespace an object is from? Pin
FruitBatInShades13-May-03 8:43
FruitBatInShades13-May-03 8:43 
AnswerRe: Find the namespace an object is from? Pin
leppie13-May-03 9:05
leppie13-May-03 9:05 
GeneralRe: Find the namespace an object is from? Pin
FruitBatInShades13-May-03 9:28
FruitBatInShades13-May-03 9:28 
GeneralControls created in one thread cannot parent in other thread - delegate. Pin
Mrso13-May-03 5:37
Mrso13-May-03 5:37 
I have a Form that react to a delegate callback and create child controls according to the delegate event argument. But when I try to create the controls and set the parent to the Form at runtime, the subjected exception raised. Any solution on this?

e.g.
Class CA : System.Windows.Forms.Form
{
public CA()
{
CB b = new CB();
b.MyEvent += new OnMyEventHandler( this.OnMyEvent );
}
protected void OnMyEvent( int nCount )
{
for ( int i = 0; i < nCount; i ++ )
{
Button btn = new Button();
btn.Parent = this; <----- Exception
btn.Location = new Point( 100 + i * 100, 10 );
btn.Show();
}
}
}

public delegate void OnMyEventHandler( int nCount );
Class CB
{
public event OnMyEventHandler myEvent;
public CB
{
if ( myEvent != null )
myEvent( 5 );
}
}

Thanks!
GeneralRe: Controls created in one thread cannot parent in other thread - delegate. Pin
leppie13-May-03 9:07
leppie13-May-03 9:07 
GeneralRe: Controls created in one thread cannot parent in other thread - delegate. Pin
Mrso14-May-03 4:19
Mrso14-May-03 4:19 
GeneralRe: Controls created in one thread cannot parent in other thread - delegate. Pin
Richard Deeming14-May-03 5:35
mveRichard Deeming14-May-03 5:35 
Generaladding form to a panel Pin
zuhx13-May-03 5:30
zuhx13-May-03 5:30 
General[Announce] diagnosing interop marshaling Pin
Stephane Rodriguez.13-May-03 5:15
Stephane Rodriguez.13-May-03 5:15 
GeneralRe: [Announce] diagnosing interop marshaling Pin
David Stone13-May-03 5:23
sitebuilderDavid Stone13-May-03 5:23 
GeneralRe: [Announce] diagnosing interop marshaling Pin
Kant13-May-03 6:15
Kant13-May-03 6:15 
GeneralRe: [Announce] diagnosing interop marshaling Pin
David Stone13-May-03 7:54
sitebuilderDavid Stone13-May-03 7:54 
GeneralRe: [Announce] diagnosing interop marshaling Pin
Kant13-May-03 8:11
Kant13-May-03 8:11 
GeneralRe: [Announce] diagnosing interop marshaling Pin
Stephane Rodriguez.13-May-03 9:08
Stephane Rodriguez.13-May-03 9:08 
GeneralRe: [Announce] diagnosing interop marshaling Pin
Richard Deeming14-May-03 5:40
mveRichard Deeming14-May-03 5:40 
GeneralRe: [Announce] diagnosing interop marshaling Pin
Stephane Rodriguez.14-May-03 6:55
Stephane Rodriguez.14-May-03 6:55 
GeneralSetting events - beginner question Pin
Neil Lamka13-May-03 4:57
Neil Lamka13-May-03 4:57 
GeneralRe: Setting events - beginner question Pin
Bo Hunter14-May-03 10:02
Bo Hunter14-May-03 10:02 
GeneralRe: Setting events - beginner question Pin
Neil Lamka14-May-03 11:29
Neil Lamka14-May-03 11:29 
GeneralRe: Setting events - beginner question Pin
Bo Hunter16-May-03 19:57
Bo Hunter16-May-03 19:57 
GeneralRe: Setting events - beginner question Pin
Neil Lamka17-May-03 5:30
Neil Lamka17-May-03 5:30 

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.