I have a Windows form, I call the method DrawToBitmap on the form. I altered the bitmap with some drawing objects.
I now want to overlay this bitmap with transparent parts over my form. Unfortunately my form contains some controls, which do not seem to want to get overlaid. the axbouser.
unFortunately, the only way I can do this is to have a semitransparent second form and place my bitmap as a background image. This method works very well with the exception It is incredibly slow.
Does anyone know how to draw my image over my form without the need to use resource intensive translucent forms?
Loading
MichaelPosted Jan 13, 2007, 9:06 PM
protected Form myChild;
public Form MyChild{
get{return myChild;}
set{myChild = value;}
}
the add the following to the child form
parent.MyChild = me;
this has to be called after you've canged the this.ParentForm
MichaelPosted Jan 13, 2007, 9:06 PM
protected Form myChild;
public Form MyChild{
get{return myChild;}
set{myChild = value;}
}
the add the following to the child form
parent.MyChild = me;
this has to be called after you've canged the this.ParentForm
Posted Jan 12, 2007, 8:43 PM
Posted Jan 12, 2007, 8:43 PM
GregPosted Jan 12, 2007, 6:10 AM
Aww man - typed out a massive reply to this post, and it got lost! :o( Here goes again then...
Ok, 2 main ways of doing this, depending on where you're declaring your child form. I'll use the local scope version, which is probably not the best way to do it, but easier for me to explain!
class ParentForm
{
string m_UserName;
private void OnButton1Click()
{
// declare new attack form
AttackForm myChildForm = new AttackForm();
if (myChildForm.ShowDialog() == DialogResult.OK)
{
// retrieve variables from Attack Form instance
m_UserName = myChildForm.myName;
}
}
}
In the AttackForm you'll need to introduce a property to return the variable (not certain 'Property' is the correct terminology), e.g.
public string myName
{
get
{
return tbxUserName.Text;
}
}
Hope this helps. I do need to mention I'm new to C#, so any mistakes above, please forgive me. I've built a simple app to demonstrate what I'm doing and it worked for me!
Cheers,
Greg
GregPosted Jan 12, 2007, 6:10 AM
Aww man - typed out a massive reply to this post, and it got lost! :o( Here goes again then...
Ok, 2 main ways of doing this, depending on where you're declaring your child form. I'll use the local scope version, which is probably not the best way to do it, but easier for me to explain!
class ParentForm
{
string m_UserName;
private void OnButton1Click()
{
// declare new attack form
AttackForm myChildForm = new AttackForm();
if (myChildForm.ShowDialog() == DialogResult.OK)
{
// retrieve variables from Attack Form instance
m_UserName = myChildForm.myName;
}
}
}
In the AttackForm you'll need to introduce a property to return the variable (not certain 'Property' is the correct terminology), e.g.
public string myName
{
get
{
return tbxUserName.Text;
}
}
Hope this helps. I do need to mention I'm new to C#, so any mistakes above, please forgive me. I've built a simple app to demonstrate what I'm doing and it worked for me!
Cheers,
Greg