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

Background on a grid

Status
Not open for further replies.

safarijoe2000

Programmer
Jul 25, 2002
38
0
0
GB
Hello,

I was wondering if it's possible to have a background on a grid.

Any help will be great.

Thanks
 
safarijoe2000

No, unlike some grid Activex, I believe it is not possible.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,

Thanks for the info.

Could I make my grid "see-through" instead ? So, I could actually have a layer underneath the grid, where I could actually add my background.

Thanks
 
Although there is an API (SetLayeredWindowAttributes) that allows to affect the opacity of a form, I don't think you can affect the opacity of a single control on that form (This requires Win2000 and up and there is a sample in the "solutions" provided with VFP)

[ignore][/ignore]

You may have a better chance with a Grid Activex that will permit the insertion of a background (Although I have yet to see one at work).

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Although you can set the opacity of many controls, the grid control will not allow this because columns in grids don't have an opacity setting.

As a test, create a form with a grid, a text box, add a table to the form's dataenvironment, and set the form's picture property to a known image file.

Set the opacity of the textbox (backstyle=0) and place the following code in the init() method of the form:

WITH THIS.grid1
FOR i = 1 TO .COLUMNCOUNT
.COLUMNS(i).text1.BACKSTYLE = 0
NEXT
ENDWITH

You'll notice the picture shows through the textbox but not the grid control.

In addition, you'll notice that the backcolor of the textbox shows when the textbox receives the focus and reverts back to underlying form's picture when it looses the focus.

As Mike states, I believe you'll need an ActiveX grid control.

Darrell

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top