Results 1 to 4 of 4

Thread: MSFlexGrid, disable cell

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Daventry, Northants, England
    Posts
    6

    Post

    Hello,
    I would be grateful if anyone could shed any light on how I might be able to disable a particular chosen cell in an MSFlexGrid. Thanks very much in advance for any replies.

    Tom

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    In Apex TrueDBGrid (www.apexsc.com) you can disable cell(s) at runtime dependant of values, database records, etc,etc, etc.

    For example, I have a TrueDBGrid in my project displaying the monthly payments required for a loan - the user can edit any payments after todays date but the payments shown before today's date are locked to prevent editing as they have already happened.

    MS FlexGrid is a cut-down, all-the-good-bits-missing version of Apex TrueDBGrid.



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    I like the MSFlexGrid, it's very Flexible and Extremely Quick to use, to Know when a Cell is Disabled, you could make use of the CellForeColor/CellBackColor Properties, ie.
    Code:
    Private Sub Form_Load()
        Dim iIndex As Integer
        
        Randomize Timer
        With MSFlexGrid1
            .FixedCols = 0
            .FixedRows = 0
            .Rows = 10
            .Cols = 4
            For iIndex = 0 To (.Rows * .Cols) - 1
                .TextArray(iIndex) = Rnd * 100
            Next
            .Col = Int(Rnd * 3)
            .Row = Int(Rnd * 9)
            .CellForeColor = vbGrayText
        End With
        MSFlexGrid1_RowColChange
    End Sub
    
    Private Sub MSFlexGrid1_RowColChange()
        Caption = IIf(MSFlexGrid1.CellForeColor = vbGrayText, "Disabled", "Enabled")
    End Sub

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Certified AllExperts Expert

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Daventry, Northants, England
    Posts
    6

    Post

    Hello chaps, thank you both for your replies, I shall investigate both.

    Regards

    Tom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width