Put RadioButtons to a Tab Control : TabControl « GUI « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » GUI » TabControl 
14.37.5.Put RadioButtons to a Tab Control
Put RadioButtons to a Tab Control
Imports System.Windows.Forms

public class TabControlRadioButton
   public Shared Sub Main
        Application.Run(New Form1)
   End Sub
End class


Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgsHandles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgsHandles Button1.Click
        If RadioButton1.Checked = True Then
            Me.BackColor = System.Drawing.Color.Red
        End If

        If RadioButton2.Checked = True Then
            Me.BackColor = System.Drawing.Color.Blue
        End If

    End Sub

End Class
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing AndAlso components IsNot Nothing Then
            components.Dispose()
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.TabControl1 = New System.Windows.Forms.TabControl
        Me.myscreensave = New System.Windows.Forms.TabPage
        Me.mybackground = New System.Windows.Forms.TabPage
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.RadioButton1 = New System.Windows.Forms.RadioButton
        Me.RadioButton2 = New System.Windows.Forms.RadioButton
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.TabControl1.SuspendLayout()
        Me.myscreensave.SuspendLayout()
        Me.mybackground.SuspendLayout()
        Me.SuspendLayout()
        '
        'TabControl1
        '
        Me.TabControl1.Controls.Add(Me.myscreensave)
        Me.TabControl1.Controls.Add(Me.mybackground)
        Me.TabControl1.Location = New System.Drawing.Point(1712)
        Me.TabControl1.Name = "TabControl1"
        Me.TabControl1.SelectedIndex = 0
        Me.TabControl1.Size = New System.Drawing.Size(379161)
        Me.TabControl1.TabIndex = 0
        '
        'myscreensave
        '
        Me.myscreensave.Controls.Add(Me.TextBox1)
        Me.myscreensave.Location = New System.Drawing.Point(421)
        Me.myscreensave.Name = "myscreensave"
        Me.myscreensave.Padding = New System.Windows.Forms.Padding(3)
        Me.myscreensave.Size = New System.Drawing.Size(371136)
        Me.myscreensave.TabIndex = 0
        Me.myscreensave.Text = "Screen Saver"
        Me.myscreensave.UseVisualStyleBackColor = True
        '
        'mybackground
        '
        Me.mybackground.Controls.Add(Me.RadioButton2)
        Me.mybackground.Controls.Add(Me.RadioButton1)
        Me.mybackground.Controls.Add(Me.Label1)
        Me.mybackground.Location = New System.Drawing.Point(421)
        Me.mybackground.Name = "mybackground"
        Me.mybackground.Padding = New System.Windows.Forms.Padding(3)
        Me.mybackground.Size = New System.Drawing.Size(371156)
        Me.mybackground.TabIndex = 1
        Me.mybackground.Text = "Color"
        Me.mybackground.UseVisualStyleBackColor = True
        '
        'TextBox1
        '
        Me.TextBox1.Location = New System.Drawing.Point(6101)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(26021)
        Me.TextBox1.TabIndex = 0
        Me.TextBox1.Text = "Function"
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(2316)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(8912)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Select"
        '
        'RadioButton1
        '
        Me.RadioButton1.AutoSize = True
        Me.RadioButton1.Location = New System.Drawing.Point(2549)
        Me.RadioButton1.Name = "RadioButton1"
        Me.RadioButton1.Size = New System.Drawing.Size(4716)
        Me.RadioButton1.TabIndex = 1
        Me.RadioButton1.TabStop = True
        Me.RadioButton1.Text = "Red"
        Me.RadioButton1.UseVisualStyleBackColor = True
        '
        'RadioButton2
        '
        Me.RadioButton2.AutoSize = True
        Me.RadioButton2.Location = New System.Drawing.Point(2571)
        Me.RadioButton2.Name = "RadioButton2"
        Me.RadioButton2.Size = New System.Drawing.Size(4716)
        Me.RadioButton2.TabIndex = 2
        Me.RadioButton2.TabStop = True
        Me.RadioButton2.Text = "Blue"
        Me.RadioButton2.UseVisualStyleBackColor = True
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(58179)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(7523)
        Me.Button1.TabIndex = 1
        Me.Button1.Text = "OK"
        Me.Button1.UseVisualStyleBackColor = True
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(250179)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(7523)
        Me.Button2.TabIndex = 2
        Me.Button2.Text = "Cancel"
        Me.Button2.UseVisualStyleBackColor = True
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(407214)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.TabControl1)
        Me.Name = "Form1"
        Me.Text = "TabControl Demo"
        Me.TabControl1.ResumeLayout(False)
        Me.myscreensave.ResumeLayout(False)
        Me.myscreensave.PerformLayout()
        Me.mybackground.ResumeLayout(False)
        Me.mybackground.PerformLayout()
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    Friend WithEvents myscreensave As System.Windows.Forms.TabPage
    Friend WithEvents mybackground As System.Windows.Forms.TabPage
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton
    Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button

End Class
14.37.TabControl
14.37.1.Tab ControlTab Control
14.37.2.TabControl and TabPagesTabControl and TabPages
14.37.3.Add new TabAdd new Tab
14.37.4.Using TabControl to display various font settingsUsing TabControl to display various font settings
14.37.5.Put RadioButtons to a Tab ControlPut RadioButtons to a Tab Control
14.37.6.Custom TabCustom Tab
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.