C# radioButtonのテキストを変更する

C#で、Textを使用して、radioButtonのテキストを変更するサンプルコードを記述してます。
環境
- OS windows10 pro 64bit
- Microsoft Visual Studio Community 2019 Version 16.7.1
Text使い方
Textに文字列を指定すると、テキストの値が変更されます。
// テキストを変更する
radioButton1.Text = "文字列";
サンプルコード
以下は、
「実行」ボタンをクリックすると、テキストの値が変更するサンプルコードとなります。
using System;
using System.Windows.Forms;
namespace FormTestApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
// テキストを変更する
radioButton1.Text = "Hello World!!";
}
}
}
変更されていることが確認できます。

-
前の記事
React.js ライブラリ「styled-content-loader」を使ってloadingを表示する 2021.05.13
-
次の記事
sakuraエディタで短形選択(列選択)を行う 2021.05.13
コメントを書く