CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    How to NOT Select last Row of MSHFlexGrid

    I have had trouble where a user clicks on the empty space below the last row of a MSHFlexGrid

    This has the same effect as clicking on the actual last row of the grid

    Is there a way to detect the click was in the empty space (rather than on the actual last row) ?

  2. #2
    Join Date
    Oct 2009
    Posts
    12

    Re: How to NOT Select last Row of MSHFlexGrid

    dear,

    First: is an empty row on the end of the gris normal? code OK ?
    second : you can check if there is an empty cell selected like this:

    create a form with a MSFlexgrid and enter the code=
    ===========================================

    Private Sub Form_Load()
    Dim i As Integer
    '§ populate the grid
    With MSFlexGrid1
    .FixedCols = 0
    .FixedRows = 0
    .Cols = 1
    .Rows = 1
    For i = 1 To 10
    .AddItem i, i
    Next
    .AddItem "", 11
    End With
    End Sub

    Private Sub MSFlexGrid1_Click()
    If MSFlexGrid1.Text = "" Then
    MsgBox ("Select other cell")
    Else
    MsgBox ("This is OK => enter here the code to proceed.....")
    End If
    End Sub

    =================================================

    See also attachment.
    br,
    Attached Files Attached Files

  3. #3
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    1,901

    Re: How to NOT Select last Row of MSHFlexGrid

    There is no empty row to test - thats the problem

    It just selects the last row when you click in the blank area under all the rows which are full of data

    You have given me an idea though - the worst case is that I add a blank row to the grid, which will then give me something to test for

    (Rather not do this if possible)

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

Featured