List box Issue
-
Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)
what do you need? show value from ListBox or show value in editbox for show text in editbox use m_Edit1.SetWindowText("text"); for read from listbox use m_List1.GetText(m_List1.GetCurSel(),str)_**
**_
whitesky
-
Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)
Iterate through the items of the list box using the GetCount(). Create an array of the edit box's in front of the boxes. Dpeneding on the count of the list go on setting the corresponding values of the list box into the edit boxes. Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
-
Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)
Pls be more specific. the last sentences are not clear. u can SetWindowText to set a window text. either u may have to create control varibles (string variable) for the controls u put in the the window or use GetDlgItem to get window handle. check MSDN for more info SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!" -
Iterate through the items of the list box using the GetCount(). Create an array of the edit box's in front of the boxes. Dpeneding on the count of the list go on setting the corresponding values of the list box into the edit boxes. Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
-
Thank you for help. I am looking for exactly same answer. Do i really need to travese all the list? Since we know when list show SSN,set the value in edit box.Is it possible to reach directly to index of SSN in the list and same for edit box? Thanks :)
I didn't get what you need to do exactly? May be you want to have a look at the LBN_SELCHANGE event of the list box. Also list box is shown at the time of initdialog and so you can put some of your code over there. Does this solve your problem? Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_
-
Hi Friends, I have one window on which I want to display SSN. SSN is one of the option in list and it value display infront of it in edit box. Can you pls help me to display these scenario. I am new to windows programming. Thanks :)
U can make use of the function GetCurSel() to get the current selected item index. Now you can use GetText(index,string) to get the selected item text into the string. Set the retrieved string into the Edit box using SeWindowText().:)