BBC BASIC for Windows
Programming >> BBC BASIC language >> Property sheet controls http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1287477753 Property sheet controls
Post by Matt on Oct 19th, 2010, 08:42am
Another question about property sheets:
With dialog boxes you can change the box title by using the command: SYS "SetWindowText", !dlg%, newtitle$
To change the main title of a propsht I've found that SYS "SetWindowText", !psh%, newtitle$ works.
However, I have tried various methods to change an individual propety sheet page title, but without success. I can't find anything in the help, am I (yet again) missing something?
Matt
Re: Property sheet controls
Post by admin on Oct 19th, 2010, 10:32am
However, I have tried various methods to change an individual propety sheet page title, but without success.
It's not a common requirement. Usually, the titles of the individual pages remain unchanged from their initial values, for as long as the property sheet is displayed. Are you sure it really makes sense to change the title(s) 'dynamically' - does it not risk confusing the user?
If you're convinced it is sensible, the only way I know to do it is to modify the property sheet template in memory. You need to set the PSP_USETITLE flag for the relevant page, and set the pszTitle member of the PROPSHEETPAGE structure to point to a NUL-terminated string containing the new title:
Richard.
Re: Property sheet controls
Post by Matt on Oct 19th, 2010, 7:59pm
Thanks for the reply.
I had considered the reason necessary, but reconsidered and I'm now going to use a dialog box instead. The reason was that the tabs were the categories for a competition, and the names of these would be changeable from one cometition to the next. However, I agree that the need would not normally arise, and I've decided to have a single dialog box with a label and buttons to pan through the categories. Part of the reason for this change is the compexity of doing it the other way.
Thanks again. Much appreciated.
Matt
Re: Property sheet controls
Post by admin on Oct 19th, 2010, 10:32pm
That gives you a lot more flexibility than a property sheet, including the ability to change the 'tab' titles on the fly without messing about with templates, but because it operates at a lower level it is somewhat more work.