Board index » cppbuilder » A little edit/design tip

A little edit/design tip

I don't know if anybody has noticed this before,
but anyway, for some reason you can't use control
characters in strings in object designer. But one
way to put control characters in strings is to
change the form view to text (right-click on the
form and select View as Text). Then you can find
the string you want to modify, and use control
characters the way you use them in delphi pascal.

Example:

I always want to have the text 'Alt+F4' right aligned
to the right of menu item 'Exit' since all windows has
this shortcut enabled by default and you can't select
this as a shortcut. Just find the menu item object and
change the Caption string

Caption = 'E&xit'

to

Caption = 'E&xit'#8#9'Alt+F4'

then right-click and select 'View as Form' to get
back the Form view.

This works the same way in Delphi.

Before I found out about this, I had to modify the
Caption property during the form creation.

Hope someone find this usefull.

Torstein

 

Re:A little edit/design tip


: "Torstein Pettersen" <torst...@bodo.online.no> wrote:

Quote
>I always want to have the text 'Alt+F4' right aligned
>to the right of menu item 'Exit' since all windows has
>this shortcut enabled by default and you can't select
>this as a shortcut.

I must be doing something wrong.

I just typed "Alt+F4" into the Shortcut field of the editor.

--
Stefan Hoffmeister (TeamB)     http://www.econos.de/
Please do apply judgement when sending email.

Re:A little edit/design tip


Stefan Hoffmeister (TeamB) <Stefan.Hoffmeis...@Econos.de> wrote in message
news:3786513b.20471987@forums.inprise.com...

Quote
> : "Torstein Pettersen" <torst...@bodo.online.no> wrote:

> >I always want to have the text 'Alt+F4' right aligned
> >to the right of menu item 'Exit' since all windows has
> >this shortcut enabled by default and you can't select
> >this as a shortcut.

> I must be doing something wrong.

> I just typed "Alt+F4" into the Shortcut field of the editor.

> --
> Stefan Hoffmeister (TeamB)     http://www.econos.de/
> Please do apply judgement when sending email.

Your right, I had not tried that, stupid me :-)) .

But this is still usefull if you need a hard linebreak
in a multiline label, just insert a '#10' where you
want it.

Unless you have another way of doing that?

Torstein

Re:A little edit/design tip


: "Torstein Pettersen" <torst...@bodo.online.no> wrote:

Quote
>Unless you have another way of doing that?

Well, multi-line property editors. <g>

Heck, I am lazy...

--
Stefan Hoffmeister (TeamB)     http://www.econos.de/
Please do apply judgement when sending email.

Other Threads