News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Need Help using ComboBox

Started by ctl3d32, July 31, 2009, 12:19:06 AM

Previous topic - Next topic

ctl3d32

Hi!

I need help using CBN_EDITCHANGE. What i want to do is whenever an item is selected in a ComboBox, the text in an EditBox is changed according to the selected item in the ComboBox.

Thanks in advance,
ctl3d32

P.S.: Language is Masm32 and RadAsm as IDE

*** Please do not treat this forum like a paid help desk. I removed the "[SOLVED] - " notation from the title.

* I meant this the first time.

ctl3d32

#1
I have found the solution in RadAsm HomePage. In Tutorials section.

I had to use CBN_SELCHANGE instead of CBN_EDITCHANGE, and othe changes.

The solution is:

.elseif eax==WM_COMMAND
mov eax,wParam
mov edx,eax
shr edx,16
and eax,0FFFFh
.if edx==BN_CLICKED
.if eax==IDC_BTN1 ;In case i have pressed button 1
invoke MessageBox,hWin,offset Msg,offset MsgTitle,MB_OK ;Displays a messagebox
.endIf
ret
.elseif edx==CBN_SELCHANGE ;In case a selection has changed in a combobox
.if eax==IDC_CBO1 ;If selection has changed in combobox1
invoke SendMessage,hCombo,WM_GETTEXT,[256],offset hEditText ;Get the selected text in the combobox
invoke MessageBox,hWin,offset hEditText,offset MsgTitle,MB_OK ;Displays a message box with this text
.endif
ret
.endif


Thanks anyway,
ctl3d32

Astro

Quote*** Please do not treat this forum like a paid help desk. I removed the "[SOLVED] - " notation from the title.
Who posted that? The OP or a Mod/Admin??

Best regards,
Astro.

hutch--

> Who posted that? The OP or a Mod/Admin??

It is not your business to argue forum policy.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php