Hey there,
I was originally trying to add a background image to a Richtextbox when I quickly found out it could not be simply achieved. I kept reading on online and stumbled upon someone who said something about creating a new usercontrol adding a richtextbox and then implementing this code to work with a textbox rather than a label:
public class TransparentLabel : Label {
public TransparentLabel() {
this.SetStyle(ControlStyles.Opaque, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
}
protected override CreateParams CreateParams {
get {
CreateParams parms = base.CreateParams;
parms.ExStyle |= 0x20;
return parms;
}
}
}
So I tried:
public class UserControl1 : RichTextbox
{
public UserControl1()
{
this.SetStyle(ControlStyles.Opaque, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
}
protected override CreateParams CreateParams
{
get
{
CreateParams parms = base.CreateParams;
parms.ExStyle |= 0x20;
return parms;
}
}
}
But I end up with the following error and I am unsure how to fix it:
Error 1 Missing partial modifier on declaration of type 'Stickies.UserControl1'; another partial declaration of this type exists
This error is on the following line:
public class UserControl1 : RichTextbox
Any help with my error or any help on another approach would be really helpful.
Thank you.