Results 1 to 11 of 11

Thread: images contained within buttons with text

  1. #1

    Thread Starter
    Addicted Member condonethis's Avatar
    Join Date
    Apr 2010
    Location
    TX
    Posts
    133

    Smile images contained within buttons with text

    I am trying to incorporate images into my buttons, but am having some difficulty doing so. I have included a solution that with more details. Please see there.


    Thanks,
    Chad
    Attached Files Attached Files

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,038

    Re: images contained within buttons with text

    Most people here are not going to blindly download a zip file. Tell us what the problem is, paste in relevant code as needed, and you will get better results.
    My usual boring signature: Nothing

  3. #3
    Lively Member
    Join Date
    Dec 2010
    Posts
    89

    Re: images contained within buttons with text

    Please describe your problem here so we can help you quicker.

  4. #4
    Hyperactive Member
    Join Date
    Dec 2000
    Location
    Sydney
    Posts
    311

    Re: images contained within buttons with text

    1: Add a Button (Button1) to your form
    2: Add an ImageList (ImageList1) to your form
    3: Change the ImageList property of Button1 to ImageList1
    4: Change the ImageIndex property of Button1 to 0
    5: Change the ImageAlign property of Button1 to MiddleLeft
    6: Change the TextAlign property of Button1 to MiddleRight

    Then add this code:
    vb Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         If Button1.ImageIndex <> 0 Then
    3.             Button1.ImageIndex = 0
    4.         Else
    5.             Button1.ImageIndex = -1
    6.         End If
    7.     End Sub

    Next time, as others have said, write your question in the forum, not in a project in a TextBox. That's like me writing my reply in Lotus Notes and asking you to download the file to see the answer.

    Cheers
    Why do today what you can tomorrow...

  5. #5

  6. #6
    Hyperactive Member
    Join Date
    Dec 2000
    Location
    Sydney
    Posts
    311

    Re: images contained within buttons with text

    Quote Originally Posted by stateofidleness View Post
    *shudders*

    funny stuff
    I remember the first time I saw a Lotus product, Lotus 1-2-3 it was. I remember thinking it's as if their dev team sat down and said, 'lets do the complete opposite to Excel, even if it makes no sense at all and we end up with the most badly designed piece of software ever.' Truely awful.
    Why do today what you can tomorrow...

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,038

    Re: images contained within buttons with text

    It also came out FAR before Excel, and was probably the first truly successful spreadsheet software that made Lotus a major player at the time. It was closely copied by Quattro Pro, thereby triggering a lawsuit from Lotus, which was not resolved until after Excel had come out and totally won the market.
    My usual boring signature: Nothing

  8. #8
    Hyperactive Member
    Join Date
    Dec 2000
    Location
    Sydney
    Posts
    311

    Re: images contained within buttons with text

    Not sure which version I saw, it would have been 12+ years ago now, whichever one it was, it looked like it had been drawn with crayons by school kids.

    Not disputing how popular it was, what it did for spreadsheets as a whole, or stating that I like Excel (I don't, I hate the way it tries to be clever and fails miserably)

    Why do today what you can tomorrow...

  9. #9

    Thread Starter
    Addicted Member condonethis's Avatar
    Join Date
    Apr 2010
    Location
    TX
    Posts
    133

    Resolved Re: images contained within buttons with text

    Quote Originally Posted by Help321 View Post
    1: Add a Button (Button1) to your form
    2: Add an ImageList (ImageList1) to your form
    3: Change the ImageList property of Button1 to ImageList1
    4: Change the ImageIndex property of Button1 to 0
    5: Change the ImageAlign property of Button1 to MiddleLeft
    6: Change the TextAlign property of Button1 to MiddleRight

    Then add this code:
    vb Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         If Button1.ImageIndex <> 0 Then
    3.             Button1.ImageIndex = 0
    4.         Else
    5.             Button1.ImageIndex = -1
    6.         End If
    7.     End Sub

    Next time, as others have said, write your question in the forum, not in a project in a TextBox. That's like me writing my reply in Lotus Notes and asking you to download the file to see the answer.

    Cheers
    Thank you very much. Was going to put an image of the program, but hindsight 20/20. Thank you for the help!

  10. #10

    Thread Starter
    Addicted Member condonethis's Avatar
    Join Date
    Apr 2010
    Location
    TX
    Posts
    133

    Question Re: images contained within buttons with text

    Is there anyway to modify the opacity of image list items?

  11. #11
    Hyperactive Member
    Join Date
    Dec 2000
    Location
    Sydney
    Posts
    311

    Re: images contained within buttons with text

    Not that I know of, but then I've never tried or searched to be able to do that. Maybe someone else can help you. Or try asking your new question in a new post.

    Cheers
    Why do today what you can tomorrow...

Tags for this Thread

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