473,320 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

transparent button upon an image

Hi!

I have a windowsform with an imagebox inside a groupbox. The imagebox shows
a image of a man with joints (for medical purose - shoulder, ancle, wrist
etc.). The user is able to mark the jonts by clicking on the spesific joint.
I solved this by using checkbox (with button-appearance) upon each joint.

I know wish to further develop my windows-application. How can I make my
button-appearance checkboxs to be transparent? I wish to to se the joint
(image) through the checkbox, not the default backcolor of the groupbox
control.

Any help or guideline appreciates.

Best regard
Hans Årsjö
May 10 '07 #1
2 5500
You might have to use ControlPaint.DrawBorder. You'd eliminate your
checkboxes and add a property to your form for each boolean value. Then in
your form's paint event, call ControlPaint.DrawBorder for each one, passing
in a ButtonBorderStyle of Inset or Outset depending on whether the value is
true or false. In MouseDown or MouseUp, check whether the mouse coordinates
are within one of the rectangles you've drawn, and if so, flip the boolean
value and Invalidate your picture box.

If you want to have complete professionalism in the mouse handling of your
drawn rectangles so they behave like buttons it gets more involved, but this
will get you started on the basic idea.

--
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets
"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:7D**********************************@microsof t.com...
Hi!

I have a windowsform with an imagebox inside a groupbox. The imagebox
shows
a image of a man with joints (for medical purose - shoulder, ancle, wrist
etc.). The user is able to mark the jonts by clicking on the spesific
joint.
I solved this by using checkbox (with button-appearance) upon each joint.

I know wish to further develop my windows-application. How can I make my
button-appearance checkboxs to be transparent? I wish to to se the joint
(image) through the checkbox, not the default backcolor of the groupbox
control.

Any help or guideline appreciates.

Best regard
Hans Årsjö

May 10 '07 #2
Hi Brian!

Thank you for your reply. I'm greatful for your help.

I'm afraid that my application will be more complicated when the drawborder
aslo should apeare as buttons...

But as you said.... It is a start :-)

"Brian Schwartz" wrote:
You might have to use ControlPaint.DrawBorder. You'd eliminate your
checkboxes and add a property to your form for each boolean value. Then in
your form's paint event, call ControlPaint.DrawBorder for each one, passing
in a ButtonBorderStyle of Inset or Outset depending on whether the value is
true or false. In MouseDown or MouseUp, check whether the mouse coordinates
are within one of the rectangles you've drawn, and if so, flip the boolean
value and Invalidate your picture box.

If you want to have complete professionalism in the mouse handling of your
drawn rectangles so they behave like buttons it gets more involved, but this
will get you started on the basic idea.

--
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets
"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:7D**********************************@microsof t.com...
Hi!

I have a windowsform with an imagebox inside a groupbox. The imagebox
shows
a image of a man with joints (for medical purose - shoulder, ancle, wrist
etc.). The user is able to mark the jonts by clicking on the spesific
joint.
I solved this by using checkbox (with button-appearance) upon each joint.

I know wish to further develop my windows-application. How can I make my
button-appearance checkboxs to be transparent? I wish to to se the joint
(image) through the checkbox, not the default backcolor of the groupbox
control.

Any help or guideline appreciates.

Best regard
Hans Årsjö


May 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fearless Freep | last post by:
I know there's a PIL mailing list but I thought I would try the question here as well. I'm using PIL on Python 1.5.2 (stop laughing, it's what the ISP has for CGI and I don't have a choice) ...
2
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am...
0
by: eruess | last post by:
Here's the scenario: I've got a whole bunch (for the sake of argument, let's say thousands) of different little 32x14 .png files that act as buttons all over a very large website. Each button...
8
by: Grahammer | last post by:
Is it possible to set the background of a usercontrol as transparent? I tried setting the background image of the usercontrol to a transparent GIF, but that caused MAJOR problems. I'm making...
0
by: jcvoon | last post by:
Hi: I'm using VS2005, I add my image into project resource file, and my picture box and button control reference the image from the project resource file, what is the default transparent color...
9
by: Chuck Anderson | last post by:
Is it possible to overlay a transparent watermark on an image - dynamically? I'd like the result to look like this example: <http://www.cycletourist.com/temp/photo.php> That is a bit of...
3
by: NickP | last post by:
Hi there, I have a usercontrol that inherits from Windows.Forms.Button. In the OnCreateControl method I set the style of the control so that it supports transparent backcolor and set the...
0
by: MasterOfTheDark | last post by:
This one's a hairy one to explain. What I've got is a class called "VistaGroupBox" that I put some nice-looking Vista-style gradients in the background and made to look like the ribbon categories...
1
by: ur4ikk | last post by:
Hi, I try to show a background image on the button control. A background of an image should be transparent (should get the control color). Unfortunately, I can't find appropriate control...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.