Click here to Skip to main content
15,900,511 members
Home / Discussions / Windows Forms
   

Windows Forms

 
Questionwin form Pin
mylogics26-Feb-10 20:52
professionalmylogics26-Feb-10 20:52 
AnswerRe: win form Pin
dan!sh 26-Feb-10 21:51
professional dan!sh 26-Feb-10 21:51 
GeneralRe: win form Pin
mylogics26-Feb-10 21:58
professionalmylogics26-Feb-10 21:58 
GeneralRe: win form Pin
RichardM14-Mar-10 7:10
RichardM14-Mar-10 7:10 
QuestionCreating an interface UI in windows forms Pin
for120625-Feb-10 7:23
for120625-Feb-10 7:23 
AnswerRe: Creating an interface UI in windows forms Pin
RichardM125-Feb-10 12:40
RichardM125-Feb-10 12:40 
AnswerRe: Creating an interface UI in windows forms Pin
BoomRShine26-Feb-10 4:03
BoomRShine26-Feb-10 4:03 
Question.NET WinForms Control as a child to a Window residing in a different process (MIXED RESULTS) [modified] Pin
mcrawley23-Feb-10 10:47
mcrawley23-Feb-10 10:47 
I am trying to set a .NET WinForms Control as a child to a Window/Form residing on another thread or in a different process altogether. I have had success in parenting a .NET WinForms Control to a native Win32 window in a separate process as well as a .NET WinForms Control to .NET Form residing in another process. However, when I do such to a .NET Form, the .NET form throws several exceptions when it is trying to paint the parent form. If I let the debugger catch and continue after each exception (a real "no no"), the child control finishes painting and the parent Form is left undrawn, with a big red "X" drawn in the background. Only when I create a custom UserControl and set it to the remote .NET Form does it work. What is wrong with the underlying paint procedures of several other controls in the .NET Framework for me to get this inconsistant behavior? Sample code is below...


.NET Control on a native Win32 window - WORKS FINE
// Create any WinForm control
Button button = new Button();

// Set the parent window of that control (aka window) to a common
// native Win32 window...in this case the Desktop window
Win32.SetParent(button.Handle, Win32.FindWindow("Progman", null));

// Continue running the message loop
Application.Run();


.NET UserControl on a Remote .NET Windows.Form - WORKS FINE
// Create a custom UserControl (set colors so you can see it. the
// standard UserControl has the same colors as the Form's background)
UserControl1 ctrl = new UserControl1();

// Set the parent window of that control (aka window) to a common
// .NET Form...in this case the Form1
Win32.SetParent(ctrl.Handle, Win32.FindWindow("WindowsForms10.Window.8.app.0.378734a", "Form1"));

// Continue running the message loop
Application.Run();


.NET Control on a Remote .NET Windows.Form - DOES NOT WORK
// Create any WinForm control
Button button = new Button();

// Set the parent window of that control (aka window) to a common
// .NET Form...in this case the Form1
Win32.SetParent(button.Handle, Win32.FindWindow("WindowsForms10.Window.8.app.0.378734a", "Form1"));

// Continue running the message loop
Application.Run();
AnswerRe: .NET WinForms Control as a child to a Window residing in a different process (MIXED RESULTS) Pin
RichardM123-Feb-10 18:51
RichardM123-Feb-10 18:51 
GeneralRe: .NET WinForms Control as a child to a Window residing in a different process (MIXED RESULTS) Pin
mcrawley25-Feb-10 9:40
mcrawley25-Feb-10 9:40 
GeneralRe: .NET WinForms Control as a child to a Window residing in a different process (MIXED RESULTS) Pin
RichardM125-Feb-10 10:13
RichardM125-Feb-10 10:13 
GeneralRe: .NET WinForms Control as a child to a Window residing in a different process (MIXED RESULTS) Pin
mcrawley25-Feb-10 12:08
mcrawley25-Feb-10 12:08 
GeneralRe: .NET WinForms Control as a child to a Window residing in a different process (MIXED RESULTS) Pin
RichardM125-Feb-10 12:34
RichardM125-Feb-10 12:34 
Questiondesktop application Pin
mylogics22-Feb-10 19:34
professionalmylogics22-Feb-10 19:34 
AnswerRe: desktop application Pin
Andy_L_J22-Feb-10 20:06
Andy_L_J22-Feb-10 20:06 
AnswerRe: desktop application Pin
BoomRShine23-Feb-10 3:53
BoomRShine23-Feb-10 3:53 
AnswerRe: desktop application Pin
Abhinav S26-Feb-10 22:27
Abhinav S26-Feb-10 22:27 
GeneralRe: desktop application Pin
mylogics26-Feb-10 22:33
professionalmylogics26-Feb-10 22:33 
QuestionComboBox trouble. Pin
Nikz222-Feb-10 6:51
Nikz222-Feb-10 6:51 
AnswerRe: ComboBox trouble. Pin
Richard MacCutchan22-Feb-10 22:28
mveRichard MacCutchan22-Feb-10 22:28 
QuestionConnecting to Active Directory Pin
John.L.Ponratnam21-Feb-10 20:16
John.L.Ponratnam21-Feb-10 20:16 
QuestionHow to attach the Smart Tags of child controls, to the user control? Pin
Vahid Rassouli21-Feb-10 9:22
Vahid Rassouli21-Feb-10 9:22 
QuestionRole of IIS / Worker process in a desktop or windows application (Distributed remoting architecture) [modified] Pin
NetQuestions18-Feb-10 19:18
NetQuestions18-Feb-10 19:18 
AnswerRe: Role of IIS / Worker process in a desktop or windows application (Distributed remoting architecture) Pin
NetQuestions18-Feb-10 23:24
NetQuestions18-Feb-10 23:24 
AnswerRe: Role of IIS / Worker process in a desktop or windows application (Distributed remoting architecture) Pin
Dave Kreskowiak22-Feb-10 3:09
mveDave Kreskowiak22-Feb-10 3:09 

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.