Click to See Complete Forum and Search --> : Editing the title bar of a dialog box


Malc
May 4th, 1999, 03:08 AM
The software I am working on manages a set of objects. Each object has a name. A dialog box allows you to change the properties of the object. The name of the object is shown in the title bar of the dialog box. I want to be able to change the name of the object by clicking in the title bar and editing the name directly. Does anyone know whether, and how this can be done?

Many thanks.

ilgar
May 11th, 1999, 12:57 AM
Maybe you should process WM_NCLBUTTONDOWN message
and use it's wparam and lparam to find out which part of non-client area was clicked.


Thanks,
Ilgar Mashayev

Dan Haddix
May 11th, 1999, 01:08 AM
Just curious but why would you want to do this??? Most of your users wouldn't expect this behavor, and may even become confused when they try drag the dialogs title bar and get a blinking carret instead. Why not just put the objects name into an edit control and allow the users to edit the name there??? This would be a more conventional approach, and would be more what your users would expect.

Malc
May 11th, 1999, 02:43 AM
Thanks for the reply.

I have actually posted this question twice because I thought the first post (this one) would get lost in the mass of other postings - I was obviously wrong.

You are probably right. Editing the title is not the expected behaviour. Someone else pointed this out in a reply to my other post.

What I actually want to do is save dialog space by allowing the user to edit the name of the object exactly where it is displayed. The name is currently displayed in the title bar of the dialog, so my first thought was to edit it there.

However, as you point out, this is not the behaviour a user would expect.

The problem with the edit control solution is that many of the property dialogs are property sheets. The Name edit control is then on just one page of the dialog.

I want the user to be able to see the name of the object they are editing no matter what the active property page is.

Having thought about it, another solution might be to have the Name field on the property sheet rather than on a page (ie. on the same part of the dialog as the OK and Cancel buttons). Do you think this would be any better?

Thanks again for the help.

Malc
May 11th, 1999, 02:47 AM
That sounds like it would be a way forward. However, it has been pointed out to me that the behaviour I am trying to achieve is a bit unconventional. I have to say that I agree. I am therefore going to try a different solution (see above).

Thank you for your help anyway.