查看: 742|回复: 3
|
vb.net要怎么retrieve combo box SelectedItem的一部分的data呢?
[复制链接]
|
|
vb.net要怎么retrieve combo box SelectedItem的一部分的data呢?
比如说我的combobox里的collections有
formula one
formula two
formula three
假设我选第一个item ---> formula one 然后display在一个label
code:
label.Text=combobox.SelectedItem.Text
label就会display "formula one"
如果我只要在选了item后只display "formula" 而已要怎么写呢?
请各位前辈帮帮忙,谢谢 |
|
|
|
|
|
|
|
发表于 7-10-2006 12:29 AM
|
显示全部楼层
Sorry for using english.
You can use substring to get the only text you want
example:
dim str1 as string
str1 = label1.text 'label1.text which hold the string variable
str1 = str1.substring(0,6) 'U will get 7 character
label1.text = str1 'Assign it to label1.text |
|
|
|
|
|
|
|
楼主 |
发表于 9-10-2006 07:28 PM
|
显示全部楼层
原帖由 ekineng 于 7-10-2006 12:29 AM 发表
Sorry for using english.
You can use substring to get the only text you want
example:
dim str1 as string
str1 = label1.text 'label1.text which hold the string variable
str1 = str1.substring(0 ...
thnx for your great suggestion
and this problem have been solved |
|
|
|
|
|
|
|
发表于 9-10-2006 08:10 PM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|