Set TextBox Height = Grid Cell Height Fails 
Author Message
 Set TextBox Height = Grid Cell Height Fails

I'm trying to overlay a Textbox on top of a MSFlexgrid Cell.
The overlay works great but the Textbox Height never seems to
adjust properly.   Using the following code:

   'Position Textbox for Cell Edit
   Text1.Visible = False

   'Reset Textbox Height -- Makes no Difference
      Text1.FontName = objFGrid.CellFontName
      Text1.FontSize = objFGrid.CellFontSize
      Text1.Refresh

   'Adjust Textbox to Cell
   Text1.Top = objFGrid.CellTop           '+ objFGrid.Top
   Text1.Left = objFGrid.CellLeft           ' + objFGrid.Left
   Text1.Width = objFGrid.CellWidth
   Text1.Height = objFGrid.CellHeight
   Text1.Text = objFGrid.Text
   Text1.SelStart = 0
   Text1.SelLength = Len(Text1.Text)
   Text1.ZOrder

   Text1.Visible = True
   Text1.SetFocus



Sat, 21 Jan 2012 03:04:47 GMT  
 Set TextBox Height = Grid Cell Height Fails

Quote:
> I'm trying to overlay a Textbox on top of a MSFlexgrid Cell.
> The overlay works great but the Textbox Height never seems to
> adjust properly. ? Using the following code:

> ? ?'Position Textbox for Cell Edit
> ? ?Text1.Visible = False

> ? ?'Reset Textbox Height -- Makes no Difference
> ? ? ? Text1.FontName = objFGrid.CellFontName
> ? ? ? Text1.FontSize = objFGrid.CellFontSize
> ? ? ? Text1.Refresh

> ? ?'Adjust Textbox to Cell
> ? ?Text1.Top = objFGrid.CellTop ? ? ? ? ? '+ objFGrid.Top
> ? ?Text1.Left = objFGrid.CellLeft ? ? ? ? ? ' + objFGrid.Left
> ? ?Text1.Width = objFGrid.CellWidth
> ? ?Text1.Height = objFGrid.CellHeight
> ? ?Text1.Text = objFGrid.Text
> ? ?Text1.SelStart = 0
> ? ?Text1.SelLength = Len(Text1.Text)
> ? ?Text1.ZOrder

> ? ?Text1.Visible = True
> ? ?Text1.SetFocus

Maybe try adding :

Text1.BorderStyle  = 0

Duke



Sat, 21 Jan 2012 06:12:38 GMT  
 Set TextBox Height = Grid Cell Height Fails
Thanks Duke -- owe you one -- works Great!!

Overlooking the obvious can sometime make life Very difficult.

David



Quote:
> I'm trying to overlay a Textbox on top of a MSFlexgrid Cell.
> The overlay works great but the Textbox Height never seems to
> adjust properly. Using the following code:

> 'Position Textbox for Cell Edit
> Text1.Visible = False

> 'Reset Textbox Height -- Makes no Difference
> Text1.FontName = objFGrid.CellFontName
> Text1.FontSize = objFGrid.CellFontSize
> Text1.Refresh

> 'Adjust Textbox to Cell
> Text1.Top = objFGrid.CellTop '+ objFGrid.Top
> Text1.Left = objFGrid.CellLeft ' + objFGrid.Left
> Text1.Width = objFGrid.CellWidth
> Text1.Height = objFGrid.CellHeight
> Text1.Text = objFGrid.Text
> Text1.SelStart = 0
> Text1.SelLength = Len(Text1.Text)
> Text1.ZOrder

> Text1.Visible = True
> Text1.SetFocus

Maybe try adding :

Text1.BorderStyle  = 0

Duke



Sat, 21 Jan 2012 06:50:09 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Determining actual row height, or setting maximum row height

2. Setting form width/height = image width/height

3. Help: Can't set form height greater than screen height

4. can't set Height for textbox

5. Problem setting the height of a textbox.

6. picture height is different from Picture.picture.height

7. picture height is different from Picture.picture.height

8. ActiveX height exceeds form height

9. picture height is different from Picture.picture.height

10. picture height is different from Picture.picture.height

11. picture height is different from Picture.picture.height

12. reading table cell height

 

 
Powered by phpBB® Forum Software