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

storing backcolor and reapplying 2

Status
Not open for further replies.

Olaf Doschke

Programmer
Oct 13, 2004
14,847
DE
RGB() also just results in one integer, you don't need anything else. Simply reapply the value you read and the color will be ok.

Bye, Olaf.
 
I have this now and I get an error when I try to save the form

mycolor = Thisform.help5.BackColor

With Thisform

If .help5.Height>38

.help5.Height=38

.help5.BackColor = RGB(mycolor)

Help!
 
Its not going as I hoped
<code>
Local myheight,mycolor

Set Step On


myheight = Thisform.help2.Height

mycolor = Rgb(255,255,255)

With Thisform

If .help2.Height>38

.help2.Height=38

Thisform.help2.BackColor = mycolor

Else


Thisform.help2.Height = 38
Thisform.help3.Height = 38
Thisform.help4.Height = 38
Thisform.help5.Height = 38
Thisform.help6.Height = 38
Thisform.help7.Height = 38
Thisform.help8.Height = 38
Thisform.help9.Height = 38
Thisform.help12.Height = 38
Thisform.help11.Height = 38


.help2.Height=myheight+50

Thisform.help2.BackColor = Rgb(255,255,0)

.help5.ZOrder = 0

Endif

.help2.Refresh

Endwith

</code>

The above is my code template with the specific help names.

Some clicks are not putting the larger box on top of the underlying ones.

Can I set zorder to 1 for all boxes in the else case in a single command?
 
Sorry, but what are you trying to achieve at all?
Above code always sets heights of controls to 38 and never to some higher value, how should that ever even work in the direction you want to go. Rethink and redo.

Bye, Olaf.
 
I'm also confused about what you are trying to achieve. What is the point of changing the height of a textbox in this way? It will still only display one line of text.

Also, you are probably getting an error with this line:

Code:
.help5.ZOrder = 0

Zorder isn't a property. It's a method. You would have to do this:

Code:
.help5.ZOrder(0)


Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike and Olaf,

The code certainly works. Drops the larger coloured box down on first click and puts all boxes back to default height on second click.

Mike's zorder tip solved my 'not on top issue' - thanks v.m.


Gendev
 
Well, I see you have a line .help2.Height=myheight+50 there I missed before. I fear you have similar code in all the helpX textbox. This is a case for a textbox class having the functionality to make itself higher or reset it's initial height depending on it's state. Besides that usage of thisform.Setall() will help very much.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top