星
星星的心情
Unregistered / Unconfirmed
GUEST, unregistred user!
该代码是实现反向选择功能,但u.isselected无效,所以无法进行反选,请高手解决.procedure SelectOther(AVg:Tvgctrl); function UnitIsInGroup(AUnit:IUnit;AGroup:IGroup):Boolean; var j:Integer; begin Result := False; for j := 0 to AGroup.UnitCount - 1 do begin if AGroup.Units[j] = AUnit then begin Result := True; Break; end; end; end;var i : Integer; Sheet : ISheet; U: IUnit;begin Sheet := AVg.vg.ActiveSheet; for i:= Sheet.UnitCount-1 downto 0 do begin U := Sheet.Units; if U.Locked then Continue; if U.isSelected then Sheet.Selection.Remove(U) else Sheet.Selection.Add(U); end;end;