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

setting edit text of combox

131 128KB
Is it possible to set the edit text portion of a combo box programmatically? I'm not processing any user entered text.

I'm using C and WinAPI only - no MFC or stuff like that.

Expand|Select|Wrap|Line Numbers
  1. hndCombo = CreateWindow(...,
  2.            WS_CHILD | WS_VISIBLE | WS_TAPSTOP |
  3.            CBS_HASSTRINGS | CBS_DROPDOWNLIST,
  4.            ...); 
  5.  
Stuff I've tried that doesn't work

Expand|Select|Wrap|Line Numbers
  1. SetWindowText(hndCombo, ...);
  2. SetDlgItemText(parent, id_combo, ...);
  3. SendMessage(hndCombo, WM_SETTEXT, 0, (LPARAM)...);
  4.  
If that isn't possible, can I limit the number of strings displayed in the dropdown so that I can add the "display" text to the end of the list and just use

Expand|Select|Wrap|Line Numbers
  1. drop down list
  2. "option 1"
  3. "option 2"
  4. "option 3"  stop showing here
  5. "display text but invisible to user"
  6.  
  7. SendMessage(hndCombo, CB_SETCURSEL, 3, 0);
  8.  
Thanks in advance
Aug 12 '12 #1
0 1338

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

Similar topics

2
by: Amanda H | last post by:
I am trying to edit a long text cell in Enterprise Manager but when I select "<long text>" and try to delete it, I get an error saying "cannot edit this cell". Could anyone tell me how to edit...
11
by: Nina | last post by:
I have a text file which stores user input. Later if user edited the input data from a input form. How can I update the input text file? If update the text file too often, would it cause...
0
by: Lakshmanakumar | last post by:
how Can i implement Masked Edit Text box using ASP
3
by: cyberco | last post by:
I must be overlooking something here... I'm trying to edit a line in a text file. I thought this was easy with fileinput, but all examples do not write the line back to the file but simply 'print'...
4
by: moondaddy | last post by:
I need to edit the text in many files so I'm writing a small routine to do this. First I have a method that loops through all the files in a directory and passes the full file path to another...
0
by: programming | last post by:
hi all, here is the php code! i am trying to use to 'edit' hyperlink to edit txt in member.txt. Problem is that it reads the values ok into an array, however when i attempt and update new...
2
by: coet | last post by:
I make program with Delphi Borland 7 and access as database, my problem is date between that I must put in edit.text first for the result came out base on the date that I put there.see My query...
18
by: Academia | last post by:
I let the use modify the text of a combobox and then I replace the selected item with the new text (in Keyup event). But if he sets the Text property to an empty string ("") that sets the...
4
by: Smish | last post by:
hi, I have a combobox which has dropdown style set to "dropdownlist"(since i dont want the element getting populated in the combobox to be edited). Apart from populating the comboxbox from...
4
by: mwcapps | last post by:
I have unformatted text in my SQL 2005 database. I'm pulling it into a masked edit text box with a (999)999-9999 mask. Unfortunately, when I attempt to save the data back it doesn't work because I...
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: 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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.