简体   繁体   English

更改从 vb.net 中的组合框中选择的特定选项的标签文本

[英]Change label text on particular option selected from combobox in vb.net

I need something if particular option selected in combobox then label text should be changed which will be pre defined.如果在组合框中选择了特定选项,我需要一些东西,然后应该更改将预定义的标签文本。 Eg If I select Option A then label should display 10 & if select Option B then labele shows 15.例如,如果我选择选项 A,则标签应显示 10,如果选择选项 B,则标签应显示 15。

Step 1: Create a combobox that has two items.第 1 步:创建一个包含两个项目的组合框。 One with value 10 and text "A" and other with value "15" and text "B"一个值为 10 和文本“A”,另一个值为“15”和文本“B”

Step 2: Now create selectedIndexChange event for combobox.第 2 步:现在为组合框创建 selectedIndexChange 事件。

Step 3: Inside selectedIndexChange event write the code to set the label text with {comboboxID}.SelectedValue第 3 步:在 selectedIndexChange 事件中编写代码以使用 {comboboxID}.SelectedValue 设置标签文本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM