Solved

Pls HELP!!!!! regarding edit box

Posted on 2000-02-26
7
178 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 10 total points
ID: 2560604
Use a CFileDialog with the OFN_NOCHANGEDIR flag.

It should give you what you want.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 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