FlexGrid Control in VB.NET to fill Grid using Text Controll RRS feed

  • Question

  • I want to type text in MSFlexGrid using text box controll mapping with MSFlexGrid cell. VB6 is work properly but Dot NEt Dosnt'. 

    This code I try to map Text box to Cell (1,1). The Problem is My Text Box is Hidden not Showing but when I type Data it is ok This is the Code

    PLease Help


    Private Sub G_ClickEvent(sender As Object, e As EventArgs) Handles G.ClickEvent

            'txtcode.Visible = False
            With G
                If .Col = 1 Then
                    If Not .Row = 1 Then
                        .Row = .Row - 1
                        strRowValue = .Text
                        If strRowValue = "" Then Exit Sub
                        .Row = .Row + 1
                    End If
                    'txtcode.Visible = True
                    'txtcode.Enabled = True
                    txtcode.Left = .CellLeft + .Left
                    txtcode.Top = .CellTop + .Top
                    txtcode.Width = .CellWidth
                    txtcode.Text = .Text
                    txtcode.Visible = True
                    intRow = .Row
                    intCol = .Col
                    'txtcode.Visible = True
                    'txtc.Visible = True
                End If
            End With

        End Sub


    Thursday, January 17, 2019 10:24 AM

All replies

  • Hello,

    For working with the .NET Framework/VB.NET you need to forget about this grid and use the DataGridView control that is standard and if that does not suit your needs consider a third party grid. 

    To give you an idea how some of your code would port and not saying it is perfect to your current code but gives you an idea how to get started.

    Private Sub DataGridView1_Click(sender As Object, e As EventArgs) Handles DataGridView1.Click
        If DataGridView1.CurrentCell.ColumnIndex = 1 AndAlso DataGridView1.CurrentRow.Index = 1 Then
            DataGridView1.CurrentCell = DataGridView1.Rows(DataGridView1.CurrentRow.Index - 1).Cells(0)
            Dim rowValue = CStr(DataGridView1.CurrentCell.Value)
            If String.IsNullOrWhiteSpace(rowValue) Then
                Exit Sub
            End If
        End If
    End Sub

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, January 17, 2019 12:08 PM
  • " The Problem is My Text Box is Hidden not Showing"

    Is the textbox underneath the other controls. Use bring to front to put textbox on top of others?


    PS I assume you mean datagridview not flexgrid.
    Thursday, January 17, 2019 12:13 PM