[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Setting transparent background on option button control

Is there any way to make the background transparent in any of the other VB controls that do not have the opaque-transparent option such as the option button control
0
emidiod
Asked:
emidiod
1 Solution
 
DalinCommented:
emidiod,
I would suggest you set the backcolar pproperty to be the same of the background (form, frame, picture box)...

I have some code to set a region transparant, but everything is "transparent", including the text... If you would like the code anyway, let me know.

regards
Dalin
0
 
bad_imaCommented:
Try the "Microsoft Forms 2.0 Object Library" which has almost all standard controls including commandbutton, option button with this option! And ... even more options!
0
 
watyCommented:
One simple way to do this is to follow the following steps:

1) In your Form_Resize event, create two rectangular Regions using CreateRectRgn API call: one the size of the form, and one where you want the rectangular hole. Don't forget to convert Twips to Pixels!

2) Use CombineRgn to create a new region from the two regions above. I think you'll need to use RGN_XOR as the operator here, or maybe RGN_DIFF.

3) Call SetWindowRgn() using the hWnd of your form and the Region you created in step (2).

4) Clean up your region resources with DeleteObject()

0
 
emidiodAuthor Commented:
where can i find "Microsoft forms 2.0 Object library"
0
 
InteqamCommented:
waty

i don't want to use msforms 2.0

i am interested in your idea, can you explain more please ?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now