1 Attachment(s)
[RESOLVED] Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)
I cant seem to get this figured out...
I have a button, that i would like to have a notification of saved items. (not important detail: user saves a "sale" for later... button will show ( 1 ) in upper right.. like iOS)
so, how do i get a red circle with a 1 to show!??
Placing a circle shape wont cover the button..
drawing a circle doesnt cover (go over) the button...
Using a picture box doesnt have a transparent background...
I will need to be able to display/hide it as well...
?? Help?
Attachment 99065
Thanks!
Re: Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)
The only way to do this in VB would be to create a new borderless, transparent form to draw the overlay on and show that, as far as I'm aware. It won't be easy getting it to line up and keeping it on top though!
Re: Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)
I am sure Dunfiddlin solution is the correct way, but it occurs to me you could always create your own control which inherits the button class. Make the backcolor transparent. Move the button text to the bottom.
use properties to load whatever image you want into the button.
You could add a label which overlays the button when you need it and display the count in it.
Belieive me, I am no expert and it is probably only my ignorance talking, but I am going to give this a try when I get home from work.
Re: Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)
it seems that simply adding a "circle" image in a picturebox, setting the parent to the button (thats key!), and a label on top works fine! i cant have it hanging over the edge but not really concerned with that. :)
Re: Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)
Quote:
Originally Posted by
Static
it seems that simply adding a "circle" image in a picturebox, setting the parent to the button (thats key!), and a label on top works fine! i cant have it hanging over the edge but not really concerned with that. :)
that's because transparency in vb.net only shows the transparent control's parent
Re: Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)
Quote:
Originally Posted by
.paul.
that's because transparency in vb.net only shows the transparent control's parent
To be precise, it's not a VB.Net limitation but a Windows Forms one. BB
1 Attachment(s)
Re: [RESOLVED] Drawing/Placing a "circle" or Image on a button (Like a notification i
Dang I see this thread is resolved.
Oh well.... Here is my amateurish try at a button like this. Not quite how I was going to do it but hey! here you go.
Re: [RESOLVED] Drawing/Placing a "circle" or Image on a button (Like a notification i
Quote:
i cant have it hanging over the edge but not really concerned with that.
Now, if you'd led with that! :rolleyes: