473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to set combobox.text = ""

I got two comboBox A & B, If use choose B, the text in combobox should be
blank.\
I try combobox.Text, selecteditem,displaymember = ""
But It seems useless. Please help Thanks

Nov 21 '05 #1
5 1521
Agnes,

I think you want to use:

Me.ComboBoxB.SelectedIndex = -1

hth,

Doug Glancy

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
I got two comboBox A & B, If use choose B, the text in combobox should be
blank.\
I try combobox.Text, selecteditem,displaymember = ""
But It seems useless. Please help Thanks

Nov 21 '05 #2
Hi Agnes,

BTW - there is a bug in the selectedindex = -1 routine; to overcome it, you
should always call it twice, thus:
combobox1.selectedindex = -1
combobox1.selectedindex = -1

HTH,

Bernie Yaeger

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
I got two comboBox A & B, If use choose B, the text in combobox should be
blank.\
I try combobox.Text, selecteditem,displaymember = ""
But It seems useless. Please help Thanks

Nov 21 '05 #3
Bernie,

Thanks for the tip, I didn't know that (along with just about anything else
about .Net!).

Doug

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:OC**************@TK2MSFTNGP15.phx.gbl...
Hi Agnes,

BTW - there is a bug in the selectedindex = -1 routine; to overcome it,
you should always call it twice, thus:
combobox1.selectedindex = -1
combobox1.selectedindex = -1

HTH,

Bernie Yaeger

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
I got two comboBox A & B, If use choose B, the text in combobox should be
blank.\
I try combobox.Text, selecteditem,displaymember = ""
But It seems useless. Please help Thanks


Nov 21 '05 #4
Oh,really thanks
"Doug Glancy" <no********@replytogroup.com> ¦b¶l¥ó
news:uX**************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
Bernie,

Thanks for the tip, I didn't know that (along with just about anything else about .Net!).

Doug

"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:OC**************@TK2MSFTNGP15.phx.gbl...
Hi Agnes,

BTW - there is a bug in the selectedindex = -1 routine; to overcome it,
you should always call it twice, thus:
combobox1.selectedindex = -1
combobox1.selectedindex = -1

HTH,

Bernie Yaeger

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
I got two comboBox A & B, If use choose B, the text in combobox should be blank.\
I try combobox.Text, selecteditem,displaymember = ""
But It seems useless. Please help Thanks



Nov 21 '05 #5
"Bernie Yaeger" <be*****@cherwellinc.com> schrieb:
BTW - there is a bug in the selectedindex = -1 routine; to overcome it, you should always call it twice, thus:
combobox1.selectedindex = -1
combobox1.selectedindex = -1


ACK:

BUG: ComboBox Does Not Clear When You Set SelectedIndex to -1
<URL:http://support.microsoft.com/?scid=kb;EN-US;327244>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jukka K. Korpela | last post by:
No, I'm not making this up, this is what http://www.w3.org/ says when accessed with a text browser, or in any decent browser in no-images mode: "Tim Berners-Lee smiling 2003-12-31: Buckingham...
4
by: j.t.w | last post by:
Hi All. I'm having a problem with my Date of Birth textbox. When I open the ..htm file, the "DoB" textbox is flat with a border. All of my other textboxes are sunken and are yellow. When I...
0
by: XmlAdoNewbie | last post by:
Hello All, I have come across something that seems a big buggy to me. I have an app with about 15 comboboxes on it. The comboboxes are loaded with name/value pairs at run time. Sometimes i will...
5
by: Kivak Wolf | last post by:
Hey everyone, I have a textbox in my web page that is going to be used to enter an E-mail into (just plain text, no HTML). Now, this will interact with a SQL database where the contents of the...
1
by: Linda | last post by:
Hi, Is there a way to do a "text" (rather than "binary") compareison with the "like" operator, without changing the global "Option Compare" setting? I don't want to risk breaking many, many...
2
by: gabon | last post by:
I'm creating a select entirely through JavaScript and very strangely IE doesn't show the text in the option elements. Here part of the code: this.form_country=document.createElement("select");...
2
by: alxasa | last post by:
Hello, I am hoping someone can help me with this. I need a javascript function, which sits inside a <input type="text" name="firstname"> line of code. Now, if someone starts typing fine, but when...
16
by: mj.redfox.mj | last post by:
Can anyone help? I have a textbox which I'm programatically adding by using the following code: txtTest = New TextBox txtTest.ID = "txtLeft" + cntCount.ToString...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.