Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invisible textbox in grid
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00107416
Message ID:
00107420
Views:
16
>I am trying to do the following in VFP 5.0a
>
>In a grid when field 4 of a record is greater than 100 I want the contents of field 2 of the same record not to be visible.
>
>I have tried this:
>
>IF thisForm.Grid1.Column4.Text1.Value > 100
> thisForm.Grid1.Column2.Text1.Visible = .F.
>ELSE
> thisForm.Grid1.Column2.Text1.Visible = .T.
>ENDIF
>
>I have placed this code in several places but the field is always visible.
>
>Just for the sake of it I have tried:
>This.Visible = .F.
>in the refresh of the textbox but it does not even work.
>
>The only thing that works is I change the column2.visible property to .F. then everything is invisible.
>
>So what is the use of this property in the textbox?
>
>Thanks in advance for your help.
>Raymond

Raymond, you may use Dynamic... properties for that.
*Grid.Init()
this.column1.DynamicForeColor = "iif(myfield > 100, this.column1.ForeColor, this.column1.BackColor)"

You also need to handle your .textbox.ForeColor and .SelectedForeColor properties similar way:

this.ForeColor = iif(this.value >100, this.BackColor, this.ForeColor)
this.SelectedForeColor = ...

in .TextBox.GotFocus (and reset it in LostFocus)

HTH,
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform