Results 1 to 5 of 5

Thread: pictures instead of option buttons

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    2

    pictures instead of option buttons

    I am looking for an example of how to add icons instead of option buttons in VB6. Any suggestions?

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: pictures instead of option buttons

    If you change the Option buttons Style to 1 - Graphical at DesignTime you can add an icon in the Picture property. It will act like a depressed command button then.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    2

    Re: pictures instead of option buttons

    Is there any way to make it so that it will not look like a command button? I want to see only icons without rectangles around them. I have seen such things in some programs, only thing is that I don't know how to achieve this.

  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: pictures instead of option buttons

    Quote Originally Posted by Abhirama
    Is there any way to make it so that it will not look like a command button? I want to see only icons without rectangles around them. I have seen such things in some programs, only thing is that I don't know how to achieve this.
    plz attach a picture or screen-shot of such application!!
    Show Appreciation. Rate Posts.

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: pictures instead of option buttons

    You could create a control array of pictures and then do the following. I only put in the code for BorderStyle as in indicator of when the "option" is clicked.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.  
    5.     picOpt(0).BorderStyle = 0
    6.     picOpt(1).BorderStyle = 0
    7.     picOpt(2).BorderStyle = 0
    8.    
    9. End Sub
    10.  
    11.  
    12. Private Sub picOpt_Click(Index As Integer)
    13.  
    14.     picOpt(0).BorderStyle = 0
    15.     picOpt(1).BorderStyle = 0
    16.     picOpt(2).BorderStyle = 0
    17.     picOpt(Index).BorderStyle = 1
    18.    
    19.     Select Case Index
    20.         Case 0
    21.             ' Do stuff for 0
    22.         Case 1
    23.             ' Do stuff for 1
    24.         Case 2
    25.             ' Do stuff for 2
    26.     End Select
    27.  
    28. End Sub

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