Click here to Skip to main content
15,886,919 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Twin TreeView Pin
Shameel4-Jul-11 18:41
professionalShameel4-Jul-11 18:41 
GeneralRe: Twin TreeView Pin
Ger Hayden4-Jul-11 21:16
Ger Hayden4-Jul-11 21:16 
GeneralRe: Twin TreeView Pin
Mycroft Holmes4-Jul-11 20:07
professionalMycroft Holmes4-Jul-11 20:07 
AnswerRe: Twin TreeView Pin
BillWoodruff16-Jul-11 20:54
professionalBillWoodruff16-Jul-11 20:54 
GeneralRe: Twin TreeView Pin
Ger Hayden16-Jul-11 23:36
Ger Hayden16-Jul-11 23:36 
Questionvb.net textspeaker Pin
damoder18-Jun-11 0:18
damoder18-Jun-11 0:18 
AnswerRe: vb.net textspeaker Pin
DaveyM698-Jun-11 0:37
professionalDaveyM698-Jun-11 0:37 
QuestionNeeds to update WinForm (seperate process) to render newly created customized controls Pin
glitteringsound2-Jun-11 13:27
glitteringsound2-Jun-11 13:27 
Hello,
I am facing a strange problem, I have launched a seperate Win Form based process with the help of Process.Start from another process.

That process just dispatched an object which actually contains .NET controls(e.g button,textbox,label,radio button etc) as information (control information I just collected from Injecting other running managed processes). After dispatching , I need to draw these controls on that process having WinForm as main window( as its form based process).

BUT THESE CONTROLS ARE NOT RENDERING ON MAIN FORM WINDOW. Main problem is having with parent control information which is not correct to me.

Take a look at Code
===================

public partial class TestController: Form, IApplicationEventsSink
{
static bool m_ControllerLoadedFirstTime = true;
ITestControl m_TakoControlHandler = null;

public Controller()
{
if (m_ControllerLoadedFirstTime == true)
{
MessageBox.Show("TAKOController called first time");
InitializeComponent();
m_ControllerLoadedFirstTime = false;
}
else
MessageBox.Show("TAKOController called second time");
}

private void Form1_Load(object sender, EventArgs e)
{
MessageBox.Show("Form1_Load");

initEnvironment();
bool bSubscriptionCreated = createSubscription();

if (bSubscriptionCreated == false)
throw new Exception(String.Format("Controller failed to create subscription with Simulator process!!"));

}
public ITestControl CreateControl(CustomControl a_CustomControl)
{
ITestControl TakoControlHandler = Factory.CreateControl(a_CustomControl);

m_TakoControlHandler = TakoControlHandler;

return TakoControlHandler;
}
private void SetProperties(CustomControl a_CustomControl)
{
m_TakoControlHandler.setPropeties(a_CustomControl);
}
public void OnProcess(CustomControl a_CustomControl)
{
MessageBox.Show("OnProcess");
ITestControl TakoHandler = CreateControl(a_CustomControl);

if (TakoHandler != null)
{
SetProperties(a_CustomControl);
m_TakoControlHandler.SetParentHandle(base.Handle);
}

base.Refresh();
base.Update();
base.Show();
}
}

while the control that I need to create and render is :

public class TestButton : Button
{
Control m_Control;

public TestButton()
{
m_Control = new Button();
}
public void SetParentHandle(IntPtr a_ControlHandle)
{
Control ParentControl = Control.FromHandle(a_ContainerHandle);
this.m_Control.Parent = ParentControl;
}
}

any body having any idea? I would be greatly obliged.
Regards
Usman
AnswerRe: Needs to update WinForm (seperate process) to render newly created customized controls Pin
Philippe Mori2-Jun-11 14:00
Philippe Mori2-Jun-11 14:00 
GeneralRe: Needs to update WinForm (seperate process) to render newly created customized controls Pin
glitteringsound2-Jun-11 19:56
glitteringsound2-Jun-11 19:56 
AnswerRe: Needs to update WinForm (seperate process) to render newly created customized controls Pin
BobJanova8-Jun-11 1:22
BobJanova8-Jun-11 1:22 
AnswerRe: Needs to update WinForm (seperate process) to render newly created customized controls Pin
Luc Pattyn8-Jun-11 2:36
sitebuilderLuc Pattyn8-Jun-11 2:36 
AnswerRe: Needs to update WinForm (seperate process) to render newly created customized controls Pin
Shameel4-Jul-11 5:14
professionalShameel4-Jul-11 5:14 
QuestionSet DataGridView cell value and add a new row Pin
Uros Calakovic26-May-11 5:08
Uros Calakovic26-May-11 5:08 
QuestionSecondhand comp BIOS disk Pin
Granny200712-May-11 13:47
Granny200712-May-11 13:47 
AnswerRe: Secondhand comp BIOS disk Pin
Dave Kreskowiak12-May-11 16:05
mveDave Kreskowiak12-May-11 16:05 
GeneralRe: Secondhand comp BIOS disk Pin
Granny200712-May-11 16:56
Granny200712-May-11 16:56 
GeneralRe: Secondhand comp BIOS disk Pin
Dave Kreskowiak12-May-11 17:27
mveDave Kreskowiak12-May-11 17:27 
AnswerRe: Secondhand comp BIOS disk Pin
dan!sh 12-May-11 18:49
professional dan!sh 12-May-11 18:49 
GeneralRe: Secondhand comp BIOS disk Pin
Granny200712-May-11 19:20
Granny200712-May-11 19:20 
GeneralRe: Secondhand comp BIOS disk Pin
Richard MacCutchan12-May-11 22:15
mveRichard MacCutchan12-May-11 22:15 
AnswerRe: Secondhand comp BIOS disk Pin
Abhinav S12-May-11 22:50
Abhinav S12-May-11 22:50 
GeneralRe: Secondhand comp BIOS disk Pin
Granny200713-May-11 12:57
Granny200713-May-11 12:57 
GeneralRe: Secondhand comp BIOS disk Pin
Thomas Krojer24-May-11 3:29
Thomas Krojer24-May-11 3:29 
QuestionHow come I can call Public Methods of a Form as if they were Shared? Pin
Sander Rossel11-May-11 8:49
professionalSander Rossel11-May-11 8:49 

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.