Results 1 to 8 of 8

Thread: [RESOLVED] Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Resolved [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?


    Name:  ios-mail-icon-red.png
Views: 1216
Size:  49.0 KB

    Thanks!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3
    Addicted Member
    Join Date
    Oct 2008
    Location
    USA
    Posts
    150

    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.
    Think.... Question.....

  4. #4

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    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.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)

    Quote Originally Posted by Static View Post
    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

  6. #6
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Drawing/Placing a "circle" or Image on a button (Like a notification in iOS)

    Quote Originally Posted by .paul. View Post
    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

  7. #7
    Addicted Member
    Join Date
    Oct 2008
    Location
    USA
    Posts
    150

    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.
    Attached Files Attached Files
    Think.... Question.....

  8. #8
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: [RESOLVED] Drawing/Placing a "circle" or Image on a button (Like a notification i

    i cant have it hanging over the edge but not really concerned with that.
    Now, if you'd led with that!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width