佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 743|回复: 3

vb.net要怎么retrieve combo box SelectedItem的一部分的data呢?

[复制链接]
发表于 6-10-2006 03:27 AM | 显示全部楼层 |阅读模式
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" 而已要怎么写呢?

请各位前辈帮帮忙,谢谢
回复

使用道具 举报


ADVERTISEMENT

发表于 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 | 显示全部楼层
原帖由 simpleMind 于 9-10-2006 07:28 PM 发表


thnx for your great suggestion

and this problem have been solved


请使用中文发言
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 23-9-2024 11:32 PM , Processed in 0.113762 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表