Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make the checkboxes in a grid's column dimmed?
Message
De
09/01/2004 08:54:47
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/01/2004 23:39:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00865332
Message ID:
00865410
Vues:
18
>Hi,
>
>I have 2 columns (sparse = .f.) which are using checkbox as the current control in a grid. One of them can be changed interactively by users. The other one is to show existing data which cannot be changed interactively by users. For this column, I want to make the checkboxes to be dimmed. However, I cannot make this column disable since users can double-click on any columns except the other checkbox column to execute the double-click event of the current control which in turn will execute the grid's double-click event. Also, I cannot change the value of the checkboxes to 2 since the checkbox has controlsource which is a field which can be either 0 or 1.
>
>I cannot find any property in the checkbox control to just dim the checkbox. Changing Value or Enable property does not work for my case since I have controlsource and users can click on the column.
>
>
>Thank you for any help.
oForm = Createobject('myForm')
oForm.Show
Read Events

Define Class myForm As Form
  DataSession = 2
  Add Object myGrid As Grid With ;
    ColumnCount=3

  Procedure myGrid.Column2.DblClick
  Wait Window 'DblClick called2' Timeout 2
Endproc
  Procedure myGrid.DblClick
  Wait Window 'DblClick called' Timeout 2
Endproc

  Procedure Load
  Rand(-1)
  Create Cursor Test (f1 l,f2 l,f3 i)
  For ix=1 To 50
    Insert Into Test Values ;
      (Int(Rand()*1000)%2=0,;
      Int(Rand()*1000)%2=0,m.ix)
  Endfor
  Locate
Endproc
  Procedure Init
  With This.myGrid
    With .Columns(1)
      .AddObject('myCheck','myGridChkBox')
      .CurrentControl = 'myCheck'
      .myCheck.Visible = .T.
      .Sparse = .F.
    Endwith
    With .Columns(2)
      .AddObject('myCheck','myGridChkBox')
      .CurrentControl = 'myCheck'
      .myCheck.Visible = .T.
      .Sparse = .F.
      .myCheck.Check1.Enabled = .F.
    Endwith
  Endwith
Endproc
  Procedure Unload
  Clear Events
Endproc
Enddefine

Define Class myGridChkBox As Container
  Width = 14
  Height = 17
  BackStyle = 0
  BorderWidth = 0
  Name = "grdcheckbox"
  Add Object Check1 As Checkbox With ;
    Top = 0, ;
    Left = 0, ;
    Height = 17, ;
    Width = 13, ;
    BackStyle = 0, ;
    Caption = "", ;
    Name = "Check1"
  Procedure Init
  With This
    .Check1.ControlSource = .Parent.ControlSource
    .Resize()
  Endwith
Endproc
  Procedure Resize
  With This.Check1
    .Left = (This.Parent.Width - .Width)/2
  Endwith
Endproc
  Procedure Check1.DblClick
  This.Parent.DblClick
Endproc
  Procedure DblClick
  This.Parent.Parent.DblClick
Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform