473,387 Members | 3,033 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,387 software developers and data experts.

Display values in a ComboBox?

Hello, I am a complete newbie with VB, so this question might sound really stupid; please bear with me.

My question is, can a combo box be used to display a value in the sense a label can?

I have developed a piece of hardware (PIC based) that I have connected to the PC over the serial port. Now, I get time from the PIC in an HH:MM format, which I would like to display in 2 combo boxes with dropdown lists; is this possible? Try as I might, I have not been able to do this, although of course I can successfully display those values in a label.

The reason I would like to display them in the combo list is that I would like to be able to change the value (using hours and minutes from the 2 combos with dropdown lists for hours and minutes) and write back into the PIC; this second part I think I can achieve, if I manage to get the original problem sorted.

Is this possible at all? Can one write to a combo list?

I would really appreciate any advise here.

Thanks and Regards,

Anand
Dec 21 '07 #1
8 2863
debasisdas
8,127 Expert 4TB
to items to the combobox try this

combo1.additem "item to add"

hope that helps you in solving problem.
Dec 21 '07 #2
Thanks for the prompt reply, Debasis.

I get a "Method or data member not found".

I'm sure I'm doing something intrinsically foolish here .....

Suppose doing runtime, I get a vale of,say, 10, for a variable.

How do I get the combobox to show the '10'?

STARTHR.AddItem 10 or STARTHR.AddItem "10" both give me the above error.

Regards,

Anand
Dec 21 '07 #3
debasisdas
8,127 Expert 4TB
Are you sure STARTHR is a combobox only , not any other control ?
Dec 21 '07 #4
Yes it is. But, I had copied and pasted this from something I had written a *long* time ago, and I think its an array; the properties shows the name as STARTHR(0).

Does this make sense? How can I change this to be a simple non-array?

Regards,

Anand
Dec 21 '07 #5
debasisdas
8,127 Expert 4TB
try this

STARTHR(0).Additem "10"
Dec 21 '07 #6
Thanks, the error has gone; but the value still doesnt show up in the combo box.

I guess I need to understand things more before I return, I don't want to use up more of your time.

Again, thanks a lot.

Regards,

Anand
Dec 21 '07 #7
Killer42
8,435 Expert 8TB
What version of VB are you using?
Dec 21 '07 #8
If you are using vb express 2005 they changed the format. combobox1.items.add "add your string here"

If you wish to display as per a text or label. Add the item then use combobox1.text = "The same string as before"

Mike
Dec 21 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Seth Delaney | last post by:
I have a form with a combobox and a list box. The combobox will list records (names of queries) that are entered in a table called tblListName. I have the combobox set to get its values from this...
3
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a...
2
by: Hanumanth Reddy | last post by:
Any one could help how to bind two table field values into combobox display member property. I mean i have two fields in a table. One is states description and another is states codes.I want to...
4
by: Keith | last post by:
Hello - this started out as a minor annoyance - and now is starting to bother me more and more - I'm hoping someone can help me. I would like to have a combobox display - NOT initially be blank...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
2
by: AMDRIT | last post by:
Hello Everyone, I would like to format the Display Members of a combobox's datasource. Is there a way to apply a format without subclassing the original datasource? For example, given a list of...
1
by: Parveen | last post by:
Is it possible to manually provide (display,value) pairs for a combo box?? The only method I'm aware of is bind the "displaymember" and "valuemember" properties of the combobox to columns in a...
1
by: gsb58 | last post by:
Hi! In MS ACCESS 2000 it is possible to set the rowsource to display two or many fields from the tblCustomers in a combobox. How can I do the same with a ComboBox in C# (SQL DB) say...on a...
3
by: BrianDH | last post by:
Hi Is there a way to have the view/display width different from the width as it sits on the form? Thanks Brian
2
by: Randy | last post by:
Hi, I have a small table - 2 columns, 5 rows. Col 1 is the key column and has integer values of 1 through 5. Column 2 is a varbinary(MAX) column and has jpg images loaded in it. What I want...
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: 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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.