| Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 | 1. Jump to cell (QStringGrid) #805 Posted by: OvalX 2003-03-04 21:07:16 | Hi all, I'm here again with needing help: In emtpy StringGrid is a cell (for example 3. column, 3. row) with some text. When I open form, on StringGrid is selected cell 1,1. By pushing a button I wanna select cell with text (3,3). How? And what is an argument CanSelect%? Baybe this is wrong? Thanx... --------------------------------------------------
DECLARE Function SetFocus Lib "user32" Alias "SetFocus" (hwnd As Long) As Long Declare Sub SelectEvent (Col%, Row%, CanSelect%) Declare Sub PushEvent
Create frm1 as QForm Width = 340: Height = 240 Caption = "Example" Create SG as QStringGrid DefaultRowHeight = 20 Cell(3,0) = "3": Cell(0,3) = "3" cell(3,3) = "Jump to me!" OnSelectCell = SelectEvent End Create Create btn1 as QButton Left = 5: Top = 150: Width = 150 Caption = "Jump to cell 3,3" OnClick = PushEvent End Create Center: ShowModal End Create
Sub PushEvent SelectEvent (3, 3, 1) SetFocus (SG.Handle) End Sub
Sub SelectEvent (Col%, Row%, CanSelect%) End Sub -------------------------------------------------- | 2. Re: Jump to cell (QStringGrid) #806 Posted by: mzito59 2003-03-05 03:08:57 | Change your PushEvent SUB to reference the column and row you wish to get the focus
Sub PushEvent SG.Col = 3 SG.Row = 3 SetFocus (SG.Handle) End Sub | Forum List • Thread List • Refresh • New Topic • Search • Previous • Next 1 |
|
|