A
anand
Hi all,
I have created a custom control which displays Image using Graphics..
I am using this control in a different windows application.
I am dynamically creating the control and putting that in the form.
In the Control's InitializeComponent() function following statement is
present
class MyControl
{
InitializeComponent()
{
this.Size = new System.Drawing.Size(150, 150);
}
DisplayImage(ImageFileName)
{
Graphics.DrawImage(...);
}
}
While creating the control dynamically I am using following statements
class Client
{
AddControl()
{
MyControl control = new MyControl();
control.Left = 10;
control.Top = 10;
control.Width = 100;
control.Height = 100;
}
}
and when I call control.DisplayImage(ImageFileName);
the function MyControl.DisplayImage() shows image correctly.
But If in AddControl() I change the control.Width > 150 or control.Height >
150.
The control does not display the image after 150.
But the trace statements in MyControl.DisplayImage() shows all the values
correctly.
Can anybody help me how to add controls dynamically, without this problem.?
Thank you in Advance.
-Anand
I have created a custom control which displays Image using Graphics..
I am using this control in a different windows application.
I am dynamically creating the control and putting that in the form.
In the Control's InitializeComponent() function following statement is
present
class MyControl
{
InitializeComponent()
{
this.Size = new System.Drawing.Size(150, 150);
}
DisplayImage(ImageFileName)
{
Graphics.DrawImage(...);
}
}
While creating the control dynamically I am using following statements
class Client
{
AddControl()
{
MyControl control = new MyControl();
control.Left = 10;
control.Top = 10;
control.Width = 100;
control.Height = 100;
}
}
and when I call control.DisplayImage(ImageFileName);
the function MyControl.DisplayImage() shows image correctly.
But If in AddControl() I change the control.Width > 150 or control.Height >
150.
The control does not display the image after 150.
But the trace statements in MyControl.DisplayImage() shows all the values
correctly.
Can anybody help me how to add controls dynamically, without this problem.?
Thank you in Advance.
-Anand