Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / Jump to cell (QStringGrid)

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. 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
--------------------------------------------------
Message2. 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 First 1 Last
掌柜推荐
 
 
¥1,800.00 ·
 
 
¥489.00 ·
 
 
¥288.00 ·
 
 
¥908.00 ·
 
 
¥748.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0