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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Editing cells in MSHFlexGrid control [modified]

Editing cells in MSHFlexGrid control [modified]

Scheduled Pinned Locked Moved Visual Basic
questionhelp
1 Posts 1 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.
  • B Offline
    B Offline
    Barry True
    wrote on last edited by
    #1

    I've got a VB DLL (VB6) that displays a form with an MSHFlexGrid control that we allow the user to edit. We are displaying combo boxes, text boxes, and other controls to allow the user to edit the cell data when the user clicks in the cell. We've got code to adjust the size and location of the text box and combo box so it is as close to the size and position of the cell. What I'm finding, however, is that with some cells the size and position of the control is pretty close to the cell's size and location. In others, however, the position is noticeably off (as much as half the cell width and height). Here is the subroutine we are calling to position the text box. The code for positioning the combo boxes is similar. Private Sub ShowMyTextBox(myText As TextBox) On Error GoTo ErrHandler Dim strTitle As String strTitle = "frmSettings_ShowMyTextBox" With myText .Width = MSHFlexGrid1.CellWidth .Left = MSHFlexGrid1.CellLeft + MSHFlexGrid1.Left .Top = MSHFlexGrid1.CellTop + MSHFlexGrid1.Top .text = MSHFlexGrid1.text & g_FirstTextChr SelectText myText .Visible = True .SetFocus .ZOrder 0 End With Exit Sub ErrHandler: HandleErrorMsg strTitle, Err, IDS_ERR_MSG2, vbExclamation End Sub The SelectText line above just selects all the text in the text box. The HandleErrorMsg line is just a sub in a BAS module that logs error information to a log file. My question: Is there a better way to position the control over the cell so the difference in the cell's size and position and the control's size and position isn't so noticeably different? -- modified at 17:34 Friday 27th April, 2007

    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