Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

  • *Experts*
Posted

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?

Posted

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.

  • *Experts*
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...