Click here to Skip to main content
15,922,630 members
Home / Discussions / C#
   

C#

 
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 
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 
The simplest solution is to marshal to call to the correct thread when the delegate is invoked:
class CA : System.Windows.Forms.Form
{
    ...
    
    protected void OnMyEvent(int nCount)
    {
        if (this.InvokeRequired)
        {
            // Marshal the call to the correct thread:
            this.Invoke(new OnMyEventHandler(this.OnMyEvent));
        }
        else
        {
            for ( int i = 0; i < nCount; i ++ )
            {
                Button btn = new Button();
                btn.Parent = this; 
                btn.Location = new Point( 100 + i * 100, 10 );
                btn.Show();
            }
        }
    }
}



"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
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 
GeneralIndex/Custom Control Pin
Kant13-May-03 4:48
Kant13-May-03 4:48 
Questionchanges in a datagrid? Pin
Manster13-May-03 4:26
Manster13-May-03 4:26 
AnswerRe: changes in a datagrid? Pin
Kant13-May-03 4:55
Kant13-May-03 4:55 

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.