- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am developing a quickwin app using cvf 6.6 .
Is there any way I can make the "return" key act like a tab key within a dialog box ? At the moment I trap the "return" key (IDOK) using a dummy callback routine. Could I change the dummy routine to move forward to the next control ? Can I in fact set the focus on a given control ?
Of lesser concern, is there a way to change the text of an existing list item in a list box ? At the moment I reload the entire list box.
Bill Buchholz
I am developing a quickwin app using cvf 6.6 .
Is there any way I can make the "return" key act like a tab key within a dialog box ? At the moment I trap the "return" key (IDOK) using a dummy callback routine. Could I change the dummy routine to move forward to the next control ? Can I in fact set the focus on a given control ?
Of lesser concern, is there a way to change the text of an existing list item in a list box ? At the moment I reload the entire list box.
Bill Buchholz
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any way I can make the "return" key act like a tab key within a dialog box ? At the moment I trap the "return" key (IDOK) using a dummy callback routine. Could I change the dummy routine to move forward to the next control ? Can I in fact set the focus on a given control ?
See here. You can set focus explicitly using SetFocus(GetDlgItem(Dlg%hWnd, IDC_CONTROL)) or adjust tab stops in dialog editor (Ctrl+D) and send WM_NEXTDLGCTL.
Of lesser concern, is there a way to change the text of an existing list item in a list box ? At the moment I reload the entire list box.
Yes, that was always possible, though docs could be a bit clearer. Use
where n is index of the item in the list.
Jugoslav
See here. You can set focus explicitly using SetFocus(GetDlgItem(Dlg%hWnd, IDC_CONTROL)) or adjust tab stops in dialog editor (Ctrl+D) and send WM_NEXTDLGCTL.
Of lesser concern, is there a way to change the text of an existing list item in a list box ? At the moment I reload the entire list box.
Yes, that was always possible, though docs could be a bit clearer. Use
j = DlgSet(Dlg, IDC_LIST1, "nTh Item", n)
where n is index of the item in the list.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. The link certainly made it clear that it can be
done but I just could not get it to work. I am not sure how to set the parameters.
I had the line:
STATUS = DLGSENDCTRLMESSAGE (DLG,IDOK,WM_NEXTDLGCTL,0,0)
which returns false after executing.
IDOK is the invisible default button mentioned in the link and the
callback routine is certainly called when return key is pressed.
The problem is that I don't know the previous and next controls so that
I can put useful information in the wparam and lparam. And I don't know the usefulness of setting controlid = idok which is simply the ID of the
callback routine.
Would really appreciate any help,
Bill
done but I just could not get it to work. I am not sure how to set the parameters.
I had the line:
STATUS = DLGSENDCTRLMESSAGE (DLG,IDOK,WM_NEXTDLGCTL,0,0)
which returns false after executing.
IDOK is the invisible default button mentioned in the link and the
callback routine is certainly called when return key is pressed.
The problem is that I don't know the previous and next controls so that
I can put useful information in the wparam and lparam. And I don't know the usefulness of setting controlid = idok which is simply the ID of the
callback routine.
Would really appreciate any help,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
WM_NEXTDLGCTL should be sent to the dialog, i.e.
If you want finer control, you might play with GetNextDlgTabItem combined with WM_NEXTDLGCTL(but with 1 as lParam), GetDlgItem, GetDlgCtrlID.
Jugoslav
j = SendMessage(Dlg%hWnd, WM_NEXTDLGCTL, 0, 0) !next control j = SendMessage(Dlg%hWnd, WM_NEXTDLGCTL, 1, 0) !previous control
If you want finer control, you might play with GetNextDlgTabItem combined with WM_NEXTDLGCTL(but with 1 as lParam), GetDlgItem, GetDlgCtrlID.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to say thanks for the help.
Now for some retro-fitting of older dialog boxes.
Being a humble quickwin programmer, it seems to be a lot of guesswork
before getting these system calls to work. It would be nice to have
a few more samples showing how to use these system calls.
Bill
to work.
Now for some retro-fitting of older dialog boxes.
Being a humble quickwin programmer, it seems to be a lot of guesswork
before getting these system calls to work. It would be nice to have
a few more samples showing how to use these system calls.
Bill
to work.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page