Mystic1112
Programmer
I'm trying to build a user control that has an "editable" flexgrid. I've looked at the FAQ 222-3262, but it doesn't address my problem. I am using the following code to position the text box:
This, according to all the examples I've been able to find, should work. However, the text box is being offset to the south and east by a seemingly random amount depending on the selected row and column.
I examined the flexgrid's .CellLeft and .CellTop properties, and they are definitely part of the problem. However, I cannot find the correct value to reduce the .CellLeft and .CellTop to get proper placement.
I am trying to create this functionality in a user control instead of directly on the form because I have to use it in several other places.
Please, if you have any suggestions or solutions, I would really appreciate it.
Thanks in advance,
Erika
Code:
With hflexgrid
txtDataEntry.Text = .Text
txtDataEntry.Visible = True
txtDataEntry.Move _
.Left + ScaleX(.CellLeft, vbTwips, UserControl.ScaleMode), _
.Top + ScaleY(.CellTop, vbTwips, UserControl.ScaleMode), _
ScaleX(.CellWidth, vbTwips, UserControl.ScaleMode), _
ScaleY(.CellHeight, vbTwips, UserControl.ScaleMode)
txtDataEntry.SetFocus
End With
This, according to all the examples I've been able to find, should work. However, the text box is being offset to the south and east by a seemingly random amount depending on the selected row and column.
I examined the flexgrid's .CellLeft and .CellTop properties, and they are definitely part of the problem. However, I cannot find the correct value to reduce the .CellLeft and .CellTop to get proper placement.
I am trying to create this functionality in a user control instead of directly on the form because I have to use it in several other places.
Please, if you have any suggestions or solutions, I would really appreciate it.
Thanks in advance,
Erika