How to make the mouse click on the Item cell when black selection color changes to other colors? (Original)

xiaoxiao2021-03-06  37

How to make the mouse click on the Item cell when black selection color changes to other colors?

Problem Description:

How to make the mouse click on the item cell (Tab Order 0) when black selection color change to other colors?

solution:

1. First of all, uncheck the Column Moving and Mouse Selection in the DW attribute;

2, write code in DW's Clicked event:

// The relevant variables used herein are declared;

Long LL_CURCOL, LL_POS, LL_COLS

String Ls_Modstring, LS_COLNAME, LS_COLOR_1, LS_COLOR_2, LS_CURCOL

if row = 0 Then Return

// Assign the two color variables here;

LS_COLOR_1 = String (RGB (255, 255, 255)))

LS_COLOR_2 = String (15780518) // Set the cell for Sky Sky Blue

// Get the current column number and the total column here;

//ll_curcol=dw_1.getcolumn ()

LS_CURCOL = Left (dw_1.getObjectatpointer (), POS (dw_1.getObjectatpoint (), "~ t") - 1)

LL_COLS = long (dw_1.object.dataWindow.column.count)

/ / Set all the Mode properties of all the backgrounds to opaque; (Note: The following sentence can actually put it in the Form's open event or DW constructor execution, you can improve efficiency;)

DW_1.SetredRAW (false)

For ll_pos = 1 to ll_cols

Ls_colname = dw_1.describe ("#" string (ll_pos) ". Name")

DW_1.Modify (ls_colname ". Background.Mode = '0')

NEXT

// This will set the background.color property of the operated column to the expression of IF judgment, and the background expression of each column other than this is set to a constant value;

For ll_pos = 1 to ll_cols

Ls_colname = dw_1.describe ("#" string (ll_pos) ". Name")

// if ll_pos <> ll_curcol kil

IF ls_colname <> ls_curcol kil

LS_MODSTRING = LS_COLNAME ". Background.color = '" ls_color_1 "" "

Else

LS_MODSTRING = LS_COLNAME ". Background.color = '" ls_color_1 "~ T IF (GetRow () = currentrow ()," ls_color_2 "," ls_color_1 ")'"

END IF

// Perform a background color modification here;

DW_1.MODIFY (LS_ModString)

NEXT

// Refresh the new background color;

DW_1.SetredRaw (True)

Operating renderings: http://blog.9cbs.net/images/blog_9cbs_net/balloonman2002/17312/o_color.jpg

转载请注明原文地址:https://www.9cbs.com/read-65031.html

New Post(0)