1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 4 - Working With Menus and Dialog Boxes - Part 3

By , About.com Guide

2 of 10

The Music Trivia Solution Code - Page 1

Dim IndexValue As Integer

Private Sub Button1_Click( _
  ByVal sender As System.Object, _
  ByVal e As System.EventArgs) _
  Handles Button1.Click
  If IndexValue = 1 Then
    If RadioButton1.Checked = True Then
      Debug.Write("Index1 True - Radio1 True" & vbCrLf)
      PictureBox1.Image = _
        System.Drawing.Image.FromFile("..\Yay.bmp")
    Else
      Debug.Write("Index1 True - Radio1 False" & vbCrLf)
      PictureBox1.Image = _
        System.Drawing.Image.FromFile("..\Boo.bmp")
    End If
  End If
  If IndexValue = 2 Then
    If RadioButton2.Checked = True Then
      Debug.Write("Index2 True - Radio1 True" & vbCrLf)
      PictureBox1.Image = _
        System.Drawing.Image.FromFile("..\Yay.bmp")
    Else
      Debug.Write("Index2 True - Radio1 False" & vbCrLf)
      PictureBox1.Image = _
        System.Drawing.Image.FromFile("..\Boo.bmp")
    End If
  End If
Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Working With Menus and Dialog Boxes - Part 3

©2009 About.com, a part of The New York Times Company.

All rights reserved.