Hi

Could I generate a dynamic dialog with several edittext and the number of them is variable.
I can get the number by another dialog at first,then i show user the dialog with edit amount of number.

Is it possible?

thanks

Terry
Posted on 2002-01-09 09:35:38 by xqterry
why not... you could handcraft a little dialog that
demands the edit-box amount and then create
those edit-boxes within a loop via CreateWindowEx.
Posted on 2002-01-09 09:46:35 by mob
In your main window's code do something like this:


.ELSEIF uMsg == WM_CREATE
@@:
mov eax, NumToCreate
shl eax, 5
invoke CreateWindowEx, WS_EX_CLIENTEDGE,\
ADDR EditClass, NULL,\
WS_CHILD or WS_VISIBLE or ES_LEFT or ES_READONLY,\
10, eax, 100, 14,\
hWnd, NULL, hInstance, NULL

; Add some code here to add their hWnds to an array
; so you can deal with them if necessary
; Notes -
; 1) It will always create at least 1 edit box
; 2) It creates them from the bottom up this may
; cause havoc with tab stopping

dec NumToCreate
jnz @B


This hasn't been tested, but I recon it should place all the edit boxes 32 "units" apart, each one being 14 "units" high (don't ask me what MS measures in, it may just be pixels).

I assume the variable NumToCreate holds the number of edit boxes to create!

Mirno
Posted on 2002-01-09 10:46:33 by Mirno
You can also use DialogBoxIndirectParam building at runtime a dialog template that fits your needs.
Posted on 2002-01-09 15:03:48 by LuHa
thanks for tips.
i tried it,and it seems hard to control layout,therefore i had to change the plan and replace by listview.

o~ is there some ways to make listview item text editable? now i had to add three edittext to get user input. sigh, i cann't imagine if the number of columns is 10 or more ... faint

Terry
Posted on 2002-01-09 22:03:51 by xqterry