Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2006.09.24;
Скачать: [xml.tar.bz2];

Вниз

как определить в каком столбце DBGrid юзер кликнул мышью?   Найти похожие ветки 

 
webpauk   (2006-09-06 12:33) [0]

Help


 
webpauk   (2006-09-06 12:35) [1]

например в событии CellClick


 
Ega23 ©   (2006-09-06 12:41) [2]


TDBGrid.OnCellClick

Occurs when the user releases the mouse in one of the cells of the grid.

type TDBGridClickEvent = procedure (Column: TColumn) of object;
property OnCellClick: TDBGridClickEvent;

Description

Write an OnCellClick event handler to take specific action when the user clicks in one of the cells of the data-aware grid. The Column parameter is the TColumn object that corresponds to the column where the mouse was when the user released the left mouse button.

OnCellClick occurs when the user releases the mouse. To take action when the user clicks down on the mouse, use the OnColEnter event.

OnCellClick will not occur when the mouse is released at the end of resizing a row or column, or when the cell is being edited.


 
webpauk   (2006-09-06 12:42) [3]


> Ega23 ©   (06.09.06 12:41) [2]

хорошо - OnColEnter. как?


 
webpauk   (2006-09-06 12:48) [4]

Grid1.SelectedIndex - вообщем то решение. Но Grid1.Option:=[dgRowSelect]


 
Ega23 ©   (2006-09-06 13:00) [5]

Задачу челиком опиши. Может оказаться, что тебе и не нужно узнавать, где мышкой кликнули.


 
webpauk   (2006-09-06 13:06) [6]

мне нужно знать столбец, в еотором кликнули мышью
нарыл уже:
var
 ScrPt, GrdPt: TPoint;
 Cell: TGridCoord;
begin
 ScrPt := Mouse.CursorPos;
 GrdPt := DBGrid.ScreenToClient(ScrPt);
 Cell := DBGrid.MouseCoord(GrdPt.X, GrdPt.Y);
 // Col := Cell.X;
 // Row := Cell.Y;
end;


 
Loginov Dmitry ©   (2006-09-06 13:34) [7]

> webpauk   (06.09.06 13:06) [6]


Можно проще:


 Row := TStringGrid(DBGrid).Row;
 Col := TStringGrid(DBGrid).Col;



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2006.09.24;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.064 c
2-1157516195
vadim.selin
2006-09-06 08:16
2006.09.24
Молоденькие девушки от Nubiles


2-1157284876
Konstantin555
2006-09-03 16:01
2006.09.24
Проблема с StringReplace...


3-1153388502
svv
2006-07-20 13:41
2006.09.24
Как правильнее запрос через ADO или хранимка и sp_executeSql


15-1157041214
Sam Stone
2006-08-31 20:20
2006.09.24
TNSListner


15-1157202905
Копир
2006-09-02 17:15
2006.09.24
С Днём Рождения, Москва! Почти 860 лет!





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский