Jump to content


Photo

NextGrid selection without focused

NextGrid

  • Please log in to reply
2 replies to this topic

#1 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 28 March 2014 - 02:07 PM

:mellow: Hey

I want to highlight a NextGrid's row, on mousemove event...

Here is my code for MouseMove method :
procedure TMyApplication.myNextGridMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var tCell: TPoint;
begin
  if ActiveControl <> TWincontrol(myNextGrid) then myNextGrid.SetFocus;
  tCell := myNextGrid.GetCellAtPos(Point(X, Y));
  if (tCell.y>=0) and (tCell.Y <= myNextGrid.RowCount) then myNextGrid.SelectedRow := tCell.Y;
end;

I want to do the same thing without giving focus to the NextGrid component
is it possible to affect a tNextGrid selection without giving focus ???


Thanks for any suggestion

LLaurent

#2 PCBleu

PCBleu
  • Members
  • 33 posts

Posted 01 April 2014 - 05:41 PM

Hey

I found a good solution

all works OK without giving focus - I had just to define the NextGrid.InactiveSelectionColor...
its value was clBtnFace and I did not see any effects on mouve events...

Thanks

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 02 April 2014 - 03:48 AM

Hi,

Great, I am glad that you find a solution.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users