Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. positioning a textbox in the AXMSFlexgrid cell

positioning a textbox in the AXMSFlexgrid cell

Scheduled Pinned Locked Moved Visual Basic
csharpcsshelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aransiola
    wrote on last edited by
    #1

    I am writng an editable grid in my vb.net2005 project. The code is working fine but text box is not well positioned in the grid cell, for me to see what im entering in teh text box im using something like this in teh FG_Keypress event textbox.setbound(fg.left+fgcell.left,fg.top+fgcell.top,fgcell.width,fgcell.height) any help will be appreciated. t.aransiola

    D 1 Reply Last reply
    0
    • A aransiola

      I am writng an editable grid in my vb.net2005 project. The code is working fine but text box is not well positioned in the grid cell, for me to see what im entering in teh text box im using something like this in teh FG_Keypress event textbox.setbound(fg.left+fgcell.left,fg.top+fgcell.top,fgcell.width,fgcell.height) any help will be appreciated. t.aransiola

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Why are you using the old FlexGrid?? What are you doing that will not let you use .NET 2.0's DataGridView??

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Why are you using the old FlexGrid?? What are you doing that will not let you use .NET 2.0's DataGridView??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        A Offline
        A Offline
        aransiola
        wrote on last edited by
        #3

        i need an editable grid like Flexgrid in vb6.0. There is AXMSFlexgrid in .net 2005 that works like vb6.0 flexgrid just that the properties and methods arent teh same See my code below, if there is any help u can render thanks positioning a textbox control in the grid cell I am using this control in my vb.net2005 project im using something like this in teh FG_Keypress event Private Sub Fg_KeyPressEvent(ByVal sender As Object, ByVal e As AxMSFlexGridLib.DMSFlexGridEvents_KeyPressEvent) Handles Fg.KeyPressEvent Select Case e.keyAscii Case 13 e.keyAscii = 0 Fg.Focus() Exit Sub End Select With Fg ' block the qty remaining column not to accept any entry Select Case .Col Case 0 EditBox.Enabled = False Exit Sub Case 1 'to upcase col1 cell entry e.keyAscii = Asc(UCase(Chr(e.keyAscii))) EditBox.Enabled = True End Select EditBox.Text = Chr(e.keyAscii) EditBox.SelectionStart = 1 EditBox.Visible = True ' 'note: the problem is here, ' EditBox.SetBounds(.Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight) EditBox.Focus() End With btnSave.Enabled = True End Sub the code works fine but the EditBox wasnot well positioned as expected. I just converted this portion that is working in vb6 to vsb.net 2005. While typing i wouldnt see the text box, but once the fg gotfocused, the content displays on teh grid t.aransiola

        D 1 Reply Last reply
        0
        • A aransiola

          i need an editable grid like Flexgrid in vb6.0. There is AXMSFlexgrid in .net 2005 that works like vb6.0 flexgrid just that the properties and methods arent teh same See my code below, if there is any help u can render thanks positioning a textbox control in the grid cell I am using this control in my vb.net2005 project im using something like this in teh FG_Keypress event Private Sub Fg_KeyPressEvent(ByVal sender As Object, ByVal e As AxMSFlexGridLib.DMSFlexGridEvents_KeyPressEvent) Handles Fg.KeyPressEvent Select Case e.keyAscii Case 13 e.keyAscii = 0 Fg.Focus() Exit Sub End Select With Fg ' block the qty remaining column not to accept any entry Select Case .Col Case 0 EditBox.Enabled = False Exit Sub Case 1 'to upcase col1 cell entry e.keyAscii = Asc(UCase(Chr(e.keyAscii))) EditBox.Enabled = True End Select EditBox.Text = Chr(e.keyAscii) EditBox.SelectionStart = 1 EditBox.Visible = True ' 'note: the problem is here, ' EditBox.SetBounds(.Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight) EditBox.Focus() End With btnSave.Enabled = True End Sub the code works fine but the EditBox wasnot well positioned as expected. I just converted this portion that is working in vb6 to vsb.net 2005. While typing i wouldnt see the text box, but once the fg gotfocused, the content displays on teh grid t.aransiola

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          aransiola wrote:

          There is AXMSFlexgrid in .net 2005 that works like vb6.0 flexgrid

          That's becuase it IS the VB6 FlexGrid. The "Ax" prefix give away the fact that it's an ActiveX control wrapped by a .NET interop class. If all you're doing is putting up textboxs so you can edit fields, you don't need the FlexGrid. You just need to use the DataGridView instead and the default textbox columns, among others, are supplied automatically.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          U 1 Reply Last reply
          0
          • D Dave Kreskowiak

            aransiola wrote:

            There is AXMSFlexgrid in .net 2005 that works like vb6.0 flexgrid

            That's becuase it IS the VB6 FlexGrid. The "Ax" prefix give away the fact that it's an ActiveX control wrapped by a .NET interop class. If all you're doing is putting up textboxs so you can edit fields, you don't need the FlexGrid. You just need to use the DataGridView instead and the default textbox columns, among others, are supplied automatically.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            U Offline
            U Offline
            User 4105874
            wrote on last edited by
            #5

            hi You are right. We can use the datagridview control. But it is not working exactly as mshflxgrd works in vb 6.0. I tried to use Datagridview The main problem i faced is that I am not able to position the focus to the cell (that is to set other cell as the current cell when the data entry of one cell is completed and enter key is pressed) which i wanted at run time. If you can help out this issue then hopefully we can use datagridview instaed of mshflxgrd. If fact i am also in the process of converting my vb 6.0 application to vb.net I am now stuck up with this issue. If you can help it out my time could be saved thanks in advance.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups