Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caption

Status
Not open for further replies.

Peping

Programmer
Aug 21, 2002
205
US
thisform.caption normally displays at the left most. How best i can add an additional caption to the right most of my form just before MinButton? Would appreciate helpful tips.

Thanks in advance,
Peping
 
HI Piping,

There is no way to specific. But Logical thing is there. Try this
You place the below code in a seperate custom METHOD.
****
thisform.caption = SPACE((THISFORM.WIDTH-LEN("CAPTION"))/6)+"CAPTION"

******


In the Resize Method of the Form Call the above custom Method.

Suggestions Invited...


gchandrujs [sunshine]
 
Peping:

Another way, if you truly want a right justified title caption, is to eliminate the title bar altogether.

Then if want the appearance of a true title bar, add a textbox the width of the form. Add the desired 'caption' text to the textbox value property and set the textbox's alignment to right aligned. The text box should be disabled and of course make it's disabled color properties the same as a title bar would be for the form's color scheme.

Caveat:

You'll need to add some intelligence in the form' activate/deactivate methods to change the color of the textbox between the appropriate 'form active' / 'form inactive' mode to mimic the behavior of a true title bar. Otherwise, you may confuse your users when they switch between other forms you may have on the screen.

Add a small square commandbutton to the right of the textbox to mimic the form close button if you like, with code to release the form.

Also, if you add the command button, you'll need to adjust the width of the textbox butt up against the left edge of the command button and place another textbox underneath the command button; with appropriate colors and disabled properties set. And of course it will have to be managed by the active/deactivate code.

Convoluted I know, but it works. I've done it.

Hope helps...

Darrell
 
Peping:

Another way, if you truly want a right justified title caption, is to eliminate the title bar altogether.

Then if want the appearance of a true title bar, add a textbox the width of the form. Add the desired 'caption' text to the textbox value property and set the textbox's alignment to right aligned. The text box should be disabled and of course make it's disabled color properties the same as the title bar's would be for the form's color scheme.

Caveat:
...
You'll need to add some intelligence to the form so when the form activates/deactivates the psuedo title bar (textbox) changes color between the appropriate 'form active' / 'form inactive' mode colors mimicking the behavior of a true title bar. Otherwise, you may confuse your users when they switch between other forms or applications. (note: the activate/deactivate or gotfocus/lostfocus methods won't work. You'll need to add a timer or some other trick to make this work. Maybe one of the other geniuses has an easier method. I'll post the timer code if you like.)
...

Add a small square commandbutton to the right of the textbox to mimic the form close button if you like, with code to release the form.

Also, if you add the command button(s), you'll need to adjust the width of the textbox to butt up against the left edge of the command button(s) and place another textbox underneath the command button with appropriate colors and disabled properties set. And of course it will have to be managed by the active/deactivate code mentioned above.

Convoluted I know, but it works. I've done it.

Hope helps...

Darrell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top