?
Solved

Pls HELP!!!!! regarding edit box

Posted on 2000-02-26
7
Medium Priority
?
182 Views
Last Modified: 2013-11-20
Hi,

in an edit box, initially there is some content, say : D:\\hyp\\database\\ ( name of the directory), then i wnat the user to enter the name of the database file, but i do not want them to change the directory name. (that is, disallow them to change the directory i set initially).

any one knows how to do that?

Pls help!!! thanks a lot!
0
Comment
Question by:greenbird
  • 3
  • 3
7 Comments
 
LVL 4

Expert Comment

by:inpras
ID: 2560580
U can show D:\\hyp\\database\\ in a static control and allow only database name in edit control.....
Just an Idea!!
0
 

Author Comment

by:greenbird
ID: 2560582
Hi,

but it does not look nice, rite? since half is static control, the other is edit box. or is it possible to make the static control look like the edit control? that is, in white background etc...i tried the styles , but can not...

any idea?

thanks a lot!
0
 
LVL 2

Accepted Solution

by:
bbousquet earned 20 total points
ID: 2560604
Use a CFileDialog with the OFN_NOCHANGEDIR flag.

It should give you what you want.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:greenbird
ID: 2560611
Hi,

hmm i did not get it. what i want is:

in an edit box, i initially write the directory name, say D:\\hyp\\database\\, i want the user to enter the name of the database file in the edit box, but without allowing them to change the dir name.

i do not use the CFileDialog...

any idea?

Thanks a lot!
0
 
LVL 2

Expert Comment

by:bbousquet
ID: 2560618
Well, you could trap every update of the edit box and refuse to accept modifications before a specified character, but that would be a pain.

You could also just refuse an invalid entry and let the user re-enter a new path/name, but I guess you don't want to do that.

What's wrong with using a CFileDialog? Common dialogs are made to be used... ;-)
0
 

Author Comment

by:greenbird
ID: 2560635
Hi,

but the database is a to-be-created one, that is, after the user specify the name, then i will create a new database with the specified name. so u c, CFileDialog is not appropraite in this case.... rite?
0
 
LVL 2

Expert Comment

by:bbousquet
ID: 2561198
Ah! Then that's another thing altogether.

Basically, you want the user to enter the name of the database file (to be created) but without changing the path to that new database.

Then I don't see why you would actually include the path in the edit box if the user is not allowed to change it. It's against all good sense.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question