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
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
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.
demands the edit-box amount and then create
those edit-boxes within a loop via CreateWindowEx.
In your main window's code do something like this:
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
.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
You can also use DialogBoxIndirectParam building at runtime a dialog template that fits your needs.
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
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