***** Programmer *****
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.
***** Programmer *****

Học lập trình từ căn bản

Tìm kiếm
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Tuyên mộ thành viên
Button 3- in c# EmptyWed Oct 24, 2012 5:28 am by quangvuspkt

» Bai tap Java can ban (Phan III )
Button 3- in c# EmptySat Sep 15, 2012 4:11 am by tsuyngam

» Bai tap Java can ban (Phan I )
Button 3- in c# EmptySat Sep 15, 2012 4:08 am by tsuyngam

» Một số bài tập C# căn bản
Button 3- in c# EmptyThu Dec 15, 2011 1:58 pm by nguyenhoduykhang

» Xem thông tin máy tính bằng c#
Button 3- in c# EmptyTue Nov 08, 2011 8:19 am by namcongtu288

» My First Browser Tree Program in VB.NET
Button 3- in c# EmptyFri Aug 12, 2011 5:50 pm by kimthaohg85

» Giúp em bài C++ này với
Button 3- in c# EmptySun Jul 31, 2011 12:19 pm by kubin

» GIUP DO XAY DUNG BO GO TIENG VIET CODE C#
Button 3- in c# EmptySun Jul 24, 2011 8:40 pm by phonui82

» CHÀO TẤT CẢ CÁC THÀNH VIÊN TRONG DIỄN ĐÀN
Button 3- in c# EmptyTue Jul 19, 2011 9:28 am by phonui82

Đăng Nhập

Quên mật khẩu



March 2024
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031

Calendar Calendar


You are not connected. Please login or register

Button 3- in c#

Go down  Thông điệp [Trang 1 trong tổng số 1 trang]

1Button 3- in c# Empty Button 3- in c# Tue Feb 16, 2010 9:40 pm

Tesulakata

Tesulakata
Thành viên
Thành viên

How to: Create a Group of Radio Buttons from a String Array


This example programmatically creates a group of Windows Forms RadioButton controls and sets their Text properties to values from an array of strings.

Code:
private void button1_Click(object sender, System.EventArgs e)
{
    string[] stringArray = new string[3];

    stringArray[0] = "Yes";
    stringArray[1] = "No";
    stringArray[2] = "Maybe";

    System.Windows.Forms.RadioButton[] radioButtons =
        new System.Windows.Forms.RadioButton[3];

    for (int i = 0; i < 3; ++i)
    {
        radioButtons[i] = new RadioButton();
        radioButtons[i].Text = stringArray[i];
        radioButtons[i].Location = new System.Drawing.Point(
            10, 10 + i * 20);
        this.Controls.Add(radioButtons[i]);
    }
}

https://programmer.4umer.com

Về Đầu Trang  Thông điệp [Trang 1 trong tổng số 1 trang]

Permissions in this forum:
Bạn không có quyền trả lời bài viết