C# numericUpDownを16進数表記に変更する

C#で、Hexadecimalを使用して、numericUpDownnumericUpDownを16進数表記に変更するサンプルコードを記述してます。
環境
- OS windows10 pro 64bit
- Microsoft Visual Studio Community 2019 Version 16.7.1
Hexadecimal使い方
Hexadecimalを使用することで、numericUpDownを16進数表記に変更することが可能です。
numericUpDown1.Hexadecimal = True / False;
サンプルコード
以下は、
「実行」ボタンをクリックすると、16進数表記に変更する
サンプルコードとなります。
using System;
using System.Windows.Forms;
namespace FormTestApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
bool flg = true;
numericUpDown1.Hexadecimal = flg;
}
}
}
16進数表記に設定されたことが確認できます。

-
前の記事
javascript lodashを使って関数を使用して配列の末尾から特定のデータを取得する 2021.08.24
-
次の記事
C# asyncとawaitを使用して非同期処理を実行する 2021.08.24
コメントを書く