Eleventeen Posted June 16, 2003 Posted June 16, 2003 I am trying to make a new control and I want to have the background of the control to be transparent. I tried to change it and it has given me an error. Can this be done somehow or do I have to re-think the design. Thanks Quote
*Experts* mutant Posted June 16, 2003 *Experts* Posted June 16, 2003 What are inheriting from? What is the error? Quote
Eleventeen Posted June 16, 2003 Author Posted June 16, 2003 I have not done any coding as of yet I hade made a new project and just started out with a new control class. When I try to make the control background to transparent it gives me a "Invalid Property" message. I can change colours no problem at all. Any suggestions on what I should inherit from? Thanks Mutant Quote
*Experts* mutant Posted June 16, 2003 *Experts* Posted June 16, 2003 Any suggestions on what I should inherit from? What functionality are you looking for? Do you want to expand a control with something or build a totally new one? Quote
Eleventeen Posted June 16, 2003 Author Posted June 16, 2003 Im building a totally new one. I want to get rid of the initial grey square grid that it makes when you do a new control library. So what I had initially thought was making it transparent and putting the object i want visible on top of the grey area. Quote
*Experts* mutant Posted June 16, 2003 *Experts* Posted June 16, 2003 The control class doesnt accept ransparent background by default. In your control constructor use this: SetStyle(ControlStyles.SupportsTransparentBackColor, True) Then in code of the form that has it set your control's background using Color.FromARGB. Quote
Eleventeen Posted June 16, 2003 Author Posted June 16, 2003 Thanks Mutant, I got it working perfectly. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.