new to vb, opt buttons and imgs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anniee
    New Member
    • Sep 2007
    • 1

    new to vb, opt buttons and imgs

    So, I'm about to ask one of the dumbest questions ever that can probably be answered easily but I can't even figure it out and I have a huge headache.

    I'm on chapter 2 of my VB 6.0 book and I'm independently studying this for school thus I have no teacher and since I've never really done programing before its not that simple for me to understand, especially with all the text, hardly any examples and being a visual learner. Now I know you have this homework policy but honestly, I feel stupid enough for asking this question which I assume is easy since its in chapter 2, I'm not trying to get you to do my homework I just don't have a teacher and I'm going to continue failing this class if I don't get it before monday. I don't understand where to put things and it doesn't tell me D:

    My problem: I can't get the pictures to work with the option buttons. For example, I'm working on this program that displays the flag to a country and in a label the name of the country when the countries option button is selected. All my book says is "you can write and event procedure to execute when a user selects the option button" GREAT! BUT HOWWW? I've been trying to list it under like

    Code:
    Private Sub optcanada_Click()
        'displays canada in label
        
        Lblmsg.Caption = "Canada"
        
        imgusa.Visible = false
        imgcanada.Visible = true
        Imgjapan.Visible = False
        imgmexico.Visible = False
    End Sub
    but that gets me a variable defined error and I don't even know what that means but it gets really mad at me and starts making the unable to click noise windows xp does and highlights the private sub option part in yellow.

    I also thought about putting it under the image part but that wouldn't make any sense because then you have no idea when to display it and four flags would display at once?


    question 2:
    There's check boxes that when you select them they can hide certain parts of the program like the country name label and the form title when selected.

    I'm assuming that under each of the check box coding things that theres going to be some sort of code like when unselected lblmessage.hide except a code that actually exists?

    thanks if you help :D I'm just so stuck so I really appreciate it.
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    #2
    Ok
    Here is a sample it ll help you a lot (I thinnk) :D
    Attached Files

    Comment

    Working...