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

Is there a way to make the checkbox grayed?

Status
Not open for further replies.

pcwc66

IS-IT--Management
Dec 14, 2001
163
US
I want to add a checkbox to a column of grid but the checkbox (inside area) need to be gray color (as if it is disabled) but the rest of the area of the column need to be white color. I need to able to double-click on the column to execute the grid's doubleclick().

If I disable the column, I get the color effect but I cannot double-click the column anymore. The forecolor only affect the caption (in my case I have no caption) and backcolor only affects the outside area of the checkbox.


Thank you for any help.
 
Hi Chris,

Will this work if the checkbox has controlsource?

Thank you for your help.
 
Hi Chris,

In my case, the controlsource is a numeric field with 0 or 1 (it is smallint in the SQL Server table). So, I cannot set the value to 2 to make it dimmed.


Thank you for any help.


 
Hi Chris,

I want all the checkboxes in that column to be greyed (the inside area) at all times since the value cannot be changed interactively by the user. The checkboxes may be blank or checked based on the value of the field. The checkbox DblClick event contains this coding
raiseevent(This.Parent.Parent, "DblClick"). So, I cannot just disable the column.

Thank you for any help.
 
pcwc66,

Can you just disable the checkbox, not the column? It will be grey, it will be unavailable to user modifications, and the column will be white, and the column seem to work as it is supposed to.
 
pcwc66,

In your initial post you say you can't disable the column because you want to execute grid's doubleclick(), and in the last one it appears you want to execute the check box's doubleclick, and therefore you cannot disable the checkbox. Can you clarify, please?
 
Hi Stella740pl,

Checkbox doubleclick has this coding:
raiseevent(This.Parent.Parent, "DblClick"). So, that's why I said I need to execute grid's doubleclick and the checkbox's doubleclick.

If the column is disabled and checkbox is enabled, the checkbox is actually not available for any user's interaction. The checkbox (the inner part and outside part) is white.

If the column is disabled and checkbox is also disabled, the checkbox is actually not available for any user's interaction. The checkbox (the inner part) is grey and (outside part) is white.

If the column is enabled and checkbox is disabled, the checkbox is not available for any user's interaction. The checkbox (the inner part) is grey and (outside part) is white.

If the column is enabled and checkbox is enabled, the checkbox is available for any user's interaction. BUT The checkbox (the inner part and outside part) is white.

Only in the last case, doubleclick on the column (actually one instance of the checkbox) will execute checkbox's doubleclick which in turn executes grid's doubleclick.

I'm not aware of a way that a user can directly trigger the doubleclick of a grid since doubleclicking on a column actually executing the current control's doubleclick event.

I hope this is clear enough.

Thank you for your help.



 

pcwc66,

I'm not aware of a way that a user can directly trigger the doubleclick of a grid since doubleclicking on a column actually executing the current control's doubleclick event.

User can trigger the doubleclick of a grid by clicking on the last rows, the area below any data. Your main question is now clear enough, but require more time.
 
Hi Stella740pl,

User can trigger the doubleclick of a grid by clicking on the last rows, the area below any data. I notice that too but I don't think any user will doubleclick on those area in normal situation. Besides below the data, you can also doubleclick beyond the last column.


Thank you for your help.
 
pcwc66,

For now, I can suggest you a partial solution only. If you make both, column and the checkbox, Enabled but ReadOnly, it will be unavailable for user's changes but still respond to the DoubleClick. But it won't be grey from this. Unfortunately, I cannot return to experimenting with this until at least Monday. So, meanwhile, you can try to start from this point, or maybe someone else can offer you a better solution.

Stella
 
The 'grey' coloring within the checkbox is actually a system setting. You may have to play with API calls in order to set it a different color and still retain access to the DblClick events.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
The 'grey' coloring within the checkbox is actually a system setting.

Oh! So it is. I thought it might be the case, but were not completely sure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top