-
February 26th, 2010, 06:12 PM
#1
C++ Listbox problem
ok so say I have items 1-29 in my listbox. and I use sendmessage to send "1" using LB_SELECTSTRING
it will select 10 instead of 1.
does anyone know why it does that?
Also would it be possible to select the index instead?
I'm making a web IDE and stuff and I'm using the Listbox to keep track how how many lines are in a richtext box and what line you are currently on.
it works like its suppose to but if I go up to line one and there is 10 in the list box it will select 10 instead of one. and I checked it is send one to it not 10
*is really confused*
-
February 26th, 2010, 07:50 PM
#2
Re: C++ Listbox problem
It's hard to say without being able to see any code. Would you be able to provide the pertinent information?
-
February 26th, 2010, 08:31 PM
#3
Re: C++ Listbox problem
Code:
int rtf_listbox_get_line;
rtf_listbox_get_line=SendMessage(rtfctl,EM_LINEFROMCHAR,negative,0)+1;
stringstream lbsl;
lbsl << rtf_listbox_get_line;
SendMessage(Line_Count,LB_SELECTSTRING,0,(LPARAM&)lbsl.str());
//cout << "Listbox Line:"<< lbsl.str()<<endl;
That will select the number from the listbox indicating the current line you are on in the rich text box.
I use some other code for my rtf on key change and stuff that will add the line number to the listbox.
-
February 28th, 2010, 12:22 AM
#4
Re: C++ Listbox problem
Is it because 10 has a 1 in it and when your at line one its select 10 because of 1?
-
February 28th, 2010, 01:14 AM
#5
Re: C++ Listbox problem
Originally Posted by Senith
Is it because 10 has a 1 in it and when your at line one its select 10 because of 1?
You would get more help if you asked your question in the proper forum, i.e. the WinAPI forum.
http://www.codeguru.com/forum/forumdisplay.php?f=47
Regards,
Paul McKenzie
-
February 28th, 2010, 03:45 AM
#6
Re: C++ Listbox problem
Originally Posted by Paul McKenzie
O ok. I will tomorrow as I'm tired right now *yawns*. I didn't know I needed to post it in the API forum though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|