help: basic stupid questions, please help tho 
Author Message
 help: basic stupid questions, please help tho

Quote:

>hello, 2 questions,
>1. i made a little dialogue based MFC app,  it has a button and textin
>field reserved (by me) for file in, how do i make it so pressing the
>browse button will open a browse window, and allow the user to select a
>file, and the filename will be displayed in the edit box

You need to declare a variable for your button (via classwizard, of
category "control" rather than "value") then handle the button clicked
event. In your handler, use a CFileDialog to get the file name.

Quote:
>2. how do i take the values in edit boxes, and store them in a CString
>variable?

Simplest method: use classwizard to declare a variable of category
"Value" & type "CString". When the dialog closes, the value is placed
in the variable.

Harder method: use GetWindowText().

HTH

Paul.
-------------------------------------------
Expressed opinions are usually my own.
Especially if they're any good (of course).
-------------------------------------------



Fri, 08 Nov 2002 03:00:00 GMT  
 help: basic stupid questions, please help tho
Read the essays on dialog box techniques, including "Who owns the GUI"
on my MVP Tips site. This should show you a lot of useful techniques.
                                joe


Quote:


>>hello, 2 questions,
>>1. i made a little dialogue based mfc app,  it has a button and textin
>>field reserved (by me) for file in, how do i make it so pressing the
>>browse button will open a browse window, and allow the user to select a
>>file, and the filename will be displayed in the edit box

>You need to declare a variable for your button (via classwizard, of
>category "control" rather than "value") then handle the button clicked
>event. In your handler, use a CFileDialog to get the file name.

>>2. how do i take the values in edit boxes, and store them in a CString
>>variable?

>Simplest method: use classwizard to declare a variable of category
>"Value" & type "CString". When the dialog closes, the value is placed
>in the variable.

>Harder method: use GetWindowText().

>HTH

>Paul.
>-------------------------------------------
>Expressed opinions are usually my own.
>Especially if they're any good (of course).
>-------------------------------------------

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Fri, 08 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A very stupid question...but please help

2. Stupid question about Lib files, PLEASE help!

3. Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!

4. A basic question in C|| Please help

5. Please help: basic MFC DLL and .ini file questions

6. Please help me help myself: Dialog basics

7. Please help!!!!Please help!!!!Please help!!!!

8. PLEASE PLEASE HELP HELP...question on interleaving C functions

9. Help Please (basic staff)

10. Stupid question...but help me!

11. Please help me with a linked list (Q about basics)

12. Help: A really stupid question.

 

 
Powered by phpBB® Forum Software