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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

caption properties 1

Status
Not open for further replies.

friend01

Programmer
Jun 4, 2009
94
CA
hi all,

simple question. I need to make the 'caption' on my command box split into 2 lines. In other words, I need to have it display:

"Please click"
"Run Query #1"

in the same buttion but exacatly as it is above (in 2 seperate lines). I can't seem to do that for some reason. The chr(10) or chr(13) is not working for me?

I know it's something pretty darn simple. Any quick help please.


Thanks,
F1
 
WordWrap = .t.

Ali Koumaiha
TeknoPCS Inc.
Dearborn heights, MI 48127
 
Hi,

Technically, WORDWRAP=.T. is not what I'm looking for. I don't want to 'wordwrap'. I want to 'skip a line'.

Anything else?

Thanks,
F1
 
i'd do it this way.

create a container (no borders)
put a button (no caption)
add 2 lables (one for each line)

click event of the containers fires as the click event of the button :)

i don't know how else to do it.

Ali Koumaiha
TeknoPCS Inc.
Dearborn heights, MI 48127
 
I could have sworn that the chr(10) or chr(13) worked. can anybody else confirm that it doesn't work?

 
I know the (CHR(13)) works in MESSAGEBOX but it doesn't owrk in CAPTION on COMMANDBOX?
 
I do not like word wrap either...

BUT switch wordwrap to .t. on the command button AND in the Init() of the button put the following:

This.caption = "Please click"+chr(13)+chr(10)+"Run Query #1
 
Hi Imageincorp,

Nope, tried it & that doesn't work either.

 
strange it just worked for me, let me recreate it and will post the code.
 
Hi Imageincorp,

I'm using VFP8. Don't know if that makes a difference or not.
 
Make the Button Large enough to accomadate the text

Code:
**************************************************
*-- Form:         form1 (c:\intelisys\form2111.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   08/21/09 11:54:01 AM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 72, ;
		Left = 101, ;
		Height = 73, ;
		Width = 123, ;
		WordWrap = .T., ;
		Caption = "Command1", ;
		Name = "Command1"


	PROCEDURE command1.Init
		this.Caption = "Please click"+chr(13)+chr(10)+"Run Query #1"+chr(13)+chr(10)+"it works"
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
 
wow, all that for a carriage return... geez....LOL

LOL
 
FYI,

this.Caption = "Please click"+chr(13)+chr(10)+"Run Query #1"+chr(13)+chr(10)+"it works"

in the init() does not work. It dos not give the result wanted. I tested it 2x.

no work

 
It works just fine in VFP6 but maybe not in other versions?
 
I guess. Strange though. Anyways, I'll simply go with the "WORDWRAP"='.T. & fix it up.

Thanks,
F1

 
If it works in VFP6 and VFP9, it HAS to work in VFP8... Check your code....
Did you set Wordwrap to .T., You must, for it to work....
 
it does work but I have to set auto-size =t. for some reason as well. it does work though. thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top