私は、C# で Win フォーム アプリケーションに取り組んでいます。ユーザー入力ベースで lable.text を変更できる機能をアプリケーションに追加したいと考えています。
アプリケーションを再コンパイルしたり、アプリケーションの言語を変更したりすることなく、いつでも変更できる定義済みの値としていくつかのラベルを設定できるように、xml ファイルを使用したい
フォーム アプリケーションで使用したい xml ファイルがあります。
<?xml version="1.0" encoding="utf-8" ?>
<product>
<product_id>1</product_id>
<product_name>Product 1</product_name>
<product_price>1000</product_price>
</product>
<product>
<product_id>2</product_id>
<product_name>Product 2</product_name>
<product_price>2000</product_price>
</product>
<product>
<product_id>3</product_id>
<product_name>Product 3</product_name>
<product_price>3000</product_price>
</product>
<product>
<product_id>4</product_id>
<product_name>Product 4</product_name>
<product_price>4000</product_price>
</product>
私のアプリケーションでは、テキストボックス1、テキストボックス2、テキストボックス3、ラベル 1 、ラベル2、ラベル3のテキストがあります
textbox1のテキスト変更についてlable1.textの値を変更したいたとえば、id に従って、ユーザーがtextbox1に 1 を入力した場合、lable テキストを製品 1 に変更する必要があります
C#とプログラミングの初心者として、これを機能させる方法がわかりません....