473,394 Members | 2,160 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,394 software developers and data experts.

How to return a specific combobo item?

How do I stick an list item from a combobox into the text property of it?
Let's say I want the first item in the combobox list to display.

With cbo
If .Items.Count = 1 then
' Display that item in the combo
.Text = <THAT ITEM> ?
end if
end with

This works, but surely there must be an easier way?

With cbo
If .Items.Count = 1 Then
For Each o In .Items
.Text = o.PropValue
Next
End If
End With

thx
Mar 29 '06 #1
2 949
mrmagoo wrote:
How do I stick an list item from a combobox into the text property of it?
Let's say I want the first item in the combobox list to display.

With cbo
If .Items.Count = 1 then
' Display that item in the combo
.Text = <THAT ITEM> ?
end if
end with

This works, but surely there must be an easier way?

With cbo
If .Items.Count = 1 Then
For Each o In .Items
.Text = o.PropValue
Next
End If
End With

thx

With cbo
If .Items.Count = 1 then
' Display that item in the combo
.SelectedIndex = 0
end if
end with

Chris
Mar 29 '06 #2
thanks!

"Chris" <no@spam.com> wrote in message
news:eN**************@TK2MSFTNGP09.phx.gbl...
mrmagoo wrote:
How do I stick an list item from a combobox into the text property of it? Let's say I want the first item in the combobox list to display.

With cbo
If .Items.Count = 1 then
' Display that item in the combo
.Text = <THAT ITEM> ?
end if
end with

This works, but surely there must be an easier way?

With cbo
If .Items.Count = 1 Then
For Each o In .Items
.Text = o.PropValue
Next
End If
End With

thx

With cbo
If .Items.Count = 1 then
' Display that item in the combo
.SelectedIndex = 0
end if
end with

Chris

Mar 29 '06 #3

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

Similar topics

47
by: Martin DeMello | last post by:
It seems to be a fairly common pattern for an object-modifying method to return None - however, this is often quite inconvenient. For instance def f(lst1, lst2): g((lst1 + lst2).reverse()) #...
5
by: Neal Coombes | last post by:
Posted to comp.lang.c++.moderated with little response. Hoping for better from the unmoderated groups: -------- Original Message -------- Subject: Return appropriately by value, (smart)...
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
4
by: gugu | last post by:
Hi I have a datagrid which has 20 rows and 20 columns, 15 of 20 columns are checkboxs and their headertexts, datafields are dynamic. I need to loop through the whole page to see if the specific...
40
by: Mark P | last post by:
I'm implementing an algorithm and the computational flow is a somewhat deep. That is, fcn A makes many calls to fcn B which makes many calls to fcn C, and so on. The return value of the outermost...
2
by: Kazmataz | last post by:
Hi, I have a xml file as follow: <months> <month index="3"> <day number="1"> <item>Shareholder meeting 2PM</item> </day> <day number="2">
4
by: Kazmataz | last post by:
Hi, I have also posted this in the .net forum but I though I ask you guys as well. I have a xml file as follow: <months> <month index="3"> <day number="1"> <item>Shareholder meeting...
10
by: Raj | last post by:
I need a VB function to return array of collections like Private Type Employee empname as string address as string salary as integer deptno as integer End Type dim employees() as Employee
1
by: apondu | last post by:
Hi, This is Govadhan, i am a begginer for web services using c#.net. I have written a small web service where in i have created a listview item in the web service method and added some data to...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.