Recent

Author Topic: How to lock a Col in a StringGrid  (Read 367 times)

Drakeo

  • Newbie
  • Posts: 1
How to lock a Col in a StringGrid
« on: May 04, 2021, 06:36:48 pm »
Hello everyone,


i'm beginning and i have to make a game with 2 players,
all players got 1 col in the StringGrid
and  i wanted to make unable to edit the part of the other player for you or for the turn, but i don't found a way to do this, if you have some tips to block a colls or other way to don't let the edition of a coll tell me

Best Wishes !

Bart

  • Hero Member
  • *****
  • Posts: 4258
    • Bart en Mariska's Webstek
Re: How to lock a Col in a StringGrid
« Reply #1 on: May 04, 2021, 06:46:53 pm »
You could use OnMouseMove to determine where the mouse is, and depending on over which column it is, adjust the grid Options to have or have not goEditing in it.

Yould also use the OnSelectEditor event of the grid to e.g. make the editor readonly (not nice, but it does the job).

Bart

 

TinyPortal © 2005-2018