Quote:
> I'm building a (my first) dialog box and I've got 6 CHECKBOXes and 2
BUTTONs.
> This part is working but I want to add a collapsible file selection box
that
> will allow the user to roam the drives at will. It should display the
current
> selection (if any), allow manual input, and have one of those [...]
buttons on
> the right of it to expand itself.
Three ways...
1. Add a list box control and send it an LB_DIR message; from the MSDN:
"An application sends an LB_DIR message to a list box to add names to the
list displayed by the list box. The message adds the names of directories
and files that match a specified string and set of file attributes. LB_DIR
can also add mapped drive letters to the list box." To send this message,
call the SendMessage function with the following parameters....
2. Use the GetOpenFileName API call. (Headers are in the COMMCTRL.INC file)
(I use this a lot).
3. If you need ONLY a directory, you can use SHBrowseForFolder..
Quote:
> Also, is there a way to have a CHECKBOX default to "ON" and, if so, how is
> that done?
I don't think you can create it that way, but you can use this API call
before you show the containing dialog:
CheckDlgButton
The CheckDlgButton function changes the check state of a button control in a
dialog:
BOOL CheckDlgButton(
HWND hDlg, // handle to dialog box
int nIDButton, // button identifier
UINT uCheck // check state (BST_CHECKED, BST_UNCHECKED)
Or you can send a message to the control using sendmessage:
An application sends a BM_SETCHECK message to set the check state of a radio
button or check box.
SendMessage(
(HWND) hWnd, // handle to destination window
BM_SETCHECK, // message to send
(WPARAM) wParam, // check state
(LPARAM) lParam // not used; must be zero
);
(Same parameters for wparam as for uCheck)
One thing, Don, if you are using powerbasic (assumed, since this is that newsgroup), it will help if you mention if you are us
ing "SDK-s tyle" (API calls) or "DDT-Style" for your controls. (Duh, I just
looked at the title of the message. I guess you are using DDT. Well, you end
up doing a lot of CONTROL SEND ... with DDT, which is the same as the
SendMessage API.)
Using DDT, I think on the button deal you can use CONTROL SET CHECK before
you do the DIALOG SHOW MODAL|MODELESS.
--
Michael Mattias
Tal Systems
Racine WI USA
Quote:
> Hi,
> Ok... my turn to ask the questions. <grin>