I have a table, click the mouse to choose a line, if press the CTRL key and then click the select multiple lines, how to write a program?
CodePudding user response:
If KeyDown (keycontrol! ) ThenIf This. An IsSelected (row) Then
Enclosing SelectRow (row, False)
The Else
Enclosing SelectRow (row, True)
End the If
The Else
Enclosing SelectRow (0, False)
Enclosing SelectRow (row, True)
Enclosing SetRow (row)
End the If
A problem to open two posts, you a lot of ah, and this code is very easy to find online!!!! Ha ha
CodePudding user response:
Google baiduCodePudding user response:
If don't have to press the CTRL key can be achieved, instead more province code://clicked event
If an isselected (il_row) then
Enclosing selectrow (il_row, false)
The else
Enclosing selectrow (il_row, true)
end if
CodePudding user response:
Give you a multi-line select code, support SHIFT even select CTRL specifyString ls_KeyDownType
If rrow & lt;=0 then Return 0
If Keydown (KeyShift! Then
The integer li_Idx
Al_aclickedrow=rrow
Enclosing setredraw (false)
Enclosing selectrow (0, false)
If il_lastclickedrow=0 then
Enclosing setredraw (true)
Return 1
End the if
If il_lastclickedrow & gt; Al_aclickedrow then
For li_Idx=il_lastclickedrow to al_aclickedrow STEP - 1
Enclosing selectrow (li_Idx, TRUE)
End for
The else
For li_Idx=il_lastclickedrow to al_aclickedrow
Enclosing selectrow (li_Idx, TRUE)
Next
End the if
Enclosing setredraw (true)
Return 1
////////////////
ElseIf enclosing an IsSelected (rrow) Then
Il_LastClickedRow=rrow
Ib_action_on_buttonup=true
ElseIf Keydown (KeyControl! Then
Il_LastClickedRow=rrow
Enclosing SelectRow (rrow, TRUE)
The Else
Il_LastClickedRow=rrow
Enclosing SelectRow (0, FALSE)
Enclosing SelectRow (rrow, TRUE)
End the If
///////////////////
If ib_action_on_buttonup Then
Ib_action_on_buttonup=false
If Keydown (KeyControl! Then
Enclosing selectrow (il_lastclickedrow, FALSE)
The Else
Enclosing SelectRow (0, FALSE)
Enclosing SelectRow (il_lastclickedrow, TRUE)
End the If
Il_lastclickedrow=0
End the If
CodePudding user response:
Thinking is the key to judge what is press the button, and then use the selectrow ()CodePudding user response:
Reference pb8.0 PFC