Board index » cppbuilder » String Grid questions

String Grid questions

I have two problems relating to string grids, and I was wondering if
anybody could help.

First off, can anyone tell me how to write text into the column and row
headings (Fixed column & row), like excel does.

Second, I'm trying to dynamically create memo boxes on my string grid
when the user drags and drops an item out of a list box.  I've got the
drag & drop to work, and the user can also drag the memo box around in
the string grid.  However what I want is to make the memo box's Top and
Left properties default to the nearest cell to the mouse's X, Y
co-ordinates.  At the moment the memo box simple changes to the mouses
X, Y co-ordinates but I want it to move to the nearest cells
co-ordinates.

Any Help would be great,

thanks in advance,

mike

 

Re:String Grid questions


Use the StringGrid's MouseToCell() and CellRect() methods to retrieve the
cell's bounding TRect, then you can use that to determine where to place the
memo

Gambit

Quote
"kerberus" <kerbe...@risc-com.co.uk> wrote in message

news:3A2A4674.93B6BAD9@risc-com.co.uk...
Quote
> Second, I'm trying to dynamically create memo boxes on my string grid
> when the user drags and drops an item out of a list box.  I've got the
> drag & drop to work, and the user can also drag the memo box around in
> the string grid.  However what I want is to make the memo box's Top and
> Left properties default to the nearest cell to the mouse's X, Y
> co-ordinates.  At the moment the memo box simple changes to the mouses
> X, Y co-ordinates but I want it to move to the nearest cells
> co-ordinates.

Other Threads