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

Grid -Highlight 1

Status
Not open for further replies.

cmergal

MIS
Oct 16, 2002
18
US
I am using VFP8 to create a form with a grid that contains 4 columns using the property sheet. The column controls are as follows:

Column 1 - checkbox (readonly=.f.)
Column 2 - textbox (readonly=.t.,opaque)
Column 3 - textbox (readonly=.t.,opaque)
Column 4 - editbox (readonly=.t.)

Also I have the following properties:
Highlight = .t.
highlightstyle= 2
HighlightBackColor= RGB(0,255,255)
BackColor = RGB(255,,255,192) && grid1 backcolor

If I select the row by clicking in any of the textboxes (i.e. clolumn 2/3) the textbox switches color to the backcolor of the grid in the selected row and to grey (only the textbox) in the other rows. If I select the row by using any other column the problem disappears in the selected row.

I tried several methods like making the textboxes transparent and others described here but no luck.

Any ideas are welcomed!!!

Thanks,

Carlos
 
DisabledBackColor?
DisabledForeColor?

Regards,

Mike

PS How do you add Checkbox and Editbox with the property sheet? I thought it could only be done programically.
 
Mike;
I tired the DisabledBackColor with no luck.

To get the controls in the grid it's a very tricky procedure that takes a couple of tries, the good thing is that it is documented go to the help of VFP8 and in the search tab write "displaying controls in grid columns" it should be the first subject it hits.

Thanks for the help I'll keep trying and we'll see.
 
How about HighlightForeColor to RGB(0,0,0)
Also check the SelectedItemForeColor and BackColor.

Regards,

Mike

PS Thanks for the add info, Cool!
 
Mike, the problem is that if I set the AllowCellSelection to .F. I can't change the check box I have on Column 1 because it behaves like a readonly column.
 
Carlos,

I have made a grid with 4 columns. Checkbox in Column1 and Editbox in Column4. Has a yellow background and cyan when selected. Haven't seen any grey problems. Here is the view code output of the Class Browser.
Code:
	ADD OBJECT grid1 AS grid WITH ;
		ColumnCount = 4, ;
		Height = 241, ;
		Left = 228, ;
		Panel = 1, ;
		Top = 108, ;
		Width = 337, ;
		BackColor = RGB(255,255,192), ;
		HighlightBackColor = RGB(0,255,255), ;
		HighlightForeColor = RGB(0,0,0), ;
		SelectedItemBackColor = RGB(0,255,255), ;
		SelectedItemForeColor = RGB(0,0,0), ;
		HighlightStyle = 2, ;
		Name = "Grid1", ;
		Column1.ControlSource = "cust.lcxfer", ;
		Column1.CurrentControl = "Check1", ;
		Column1.Width = 26, ;
		Column1.Sparse = .F., ;
		Column1.BackColor = RGB(255,255,192), ;
		Column1.Name = "Column1", ;
		Column2.Width = 34, ;
		Column2.BackColor = RGB(255,255,192), ;
		Column2.Name = "Column2", ;
		Column3.Width = 125, ;
		Column3.BackColor = RGB(255,255,192), ;
		Column3.Name = "Column3", ;
		Column4.CurrentControl = "Edit1", ;
		Column4.Width = 95, ;
		Column4.ReadOnly = .T., ;
		Column4.BackColor = RGB(255,255,192), ;
		Column4.Name = "Column4"


	ADD OBJECT form1.grid1.column1.header1 AS header WITH ;
		Caption = "Header1", ;
		Name = "Header1"


	ADD OBJECT form1.grid1.column1.text1 AS textbox WITH ;
		BorderStyle = 0, ;
		Margin = 0, ;
		ForeColor = RGB(0,0,0), ;
		BackColor = RGB(255,255,255), ;
		SelectedForeColor = RGB(0,0,0), ;
		SelectedBackColor = RGB(0,255,255), ;
		Name = "Text1"


	ADD OBJECT form1.grid1.column1.check1 AS checkbox WITH ;
		Top = 59, ;
		Left = 41, ;
		Height = 17, ;
		Width = 60, ;
		Caption = "", ;
		ControlSource = "lcxfer", ;
		BackColor = RGB(255,255,192), ;
		Name = "Check1"


	ADD OBJECT form1.grid1.column2.header1 AS header WITH ;
		Caption = "Header1", ;
		Name = "Header1"


	ADD OBJECT form1.grid1.column2.text1 AS textbox WITH ;
		BorderStyle = 0, ;
		Margin = 0, ;
		ReadOnly = .T., ;
		ForeColor = RGB(0,0,0), ;
		BackColor = RGB(255,255,192), ;
		SelectedForeColor = RGB(0,0,0), ;
		SelectedBackColor = RGB(0,255,255), ;
		Name = "Text1"


	ADD OBJECT form1.grid1.column3.header1 AS header WITH ;
		Caption = "Header1", ;
		Name = "Header1"


	ADD OBJECT form1.grid1.column3.text1 AS textbox WITH ;
		BorderStyle = 0, ;
		Margin = 0, ;
		ReadOnly = .T., ;
		ForeColor = RGB(0,0,0), ;
		BackColor = RGB(255,255,192), ;
		SelectedForeColor = RGB(0,0,0), ;
		SelectedBackColor = RGB(0,255,255), ;
		Name = "Text1"


	ADD OBJECT form1.grid1.column4.header1 AS header WITH ;
		Caption = "Header1", ;
		Name = "Header1"


	ADD OBJECT form1.grid1.column4.text1 AS textbox WITH ;
		BorderStyle = 0, ;
		Margin = 0, ;
		ForeColor = RGB(0,0,0), ;
		BackColor = RGB(255,255,255), ;
		SelectedForeColor = RGB(0,0,0), ;
		SelectedBackColor = RGB(0,255,255), ;
		Name = "Text1"


	ADD OBJECT form1.grid1.column4.edit1 AS editbox WITH ;
		BorderStyle = 0, ;
		Height = 53, ;
		Left = 29, ;
		ReadOnly = .T., ;
		Top = 59, ;
		Width = 100, ;
		BackColor = RGB(255,255,192), ;
		DisabledBackColor = RGB(0,255,255), ;
		SelectedForeColor = RGB(0,0,0), ;
		DisabledForeColor = RGB(0,0,0), ;
		SelectedBackColor = RGB(0,255,255), ;
		Name = "Edit1"
Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top