Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ms forms2.0 combo in ms flexgrid 1

Status
Not open for further replies.

pitamber

Programmer
Apr 10, 2003
15
US
I am using ms forms2.0 combo box in ms flex grid.
but i am not success to set combo box zorder so that it can be seen on the grid
by default combo box remain behind grid.

can any one help me out

thanks in advance
 
Is the MS forms combo within a picture box?

zemp
 
Thanks zemp for considering my probs
This is simple combo box u will get when u add component
ms forms2.0 control liberary
As we make flex grid editable by taking text box and simple combo box same way i want with ms forms2.0 combo box.
One more thing my flex grid should add row at run time after
reacing the last coloum as in sqlserver enterprise manager.

thnx
 
In order for the MSForms combo box to show up on to of the grid you need to place it in a picture box. Just set the combo box to the same size as the picture box and you won't see the picture box. Otherwise you can just use the standard VB combo box. Less of a hassle that way.

To add a row just use code similar to
Code:
MSFlexgrid1.Rows = MSFlexgrid1.Rows + 1

zemp
 
Thnx Zemp once again
I am using ms forms2.0 combo as my requirement is
3coloum with proper alignment

as per u r suggestion i will use picture box
if success i will reply to u

thnx
 
I can't use picture box as order of this combo is lower than
picture i mean it go behind picture box also

any way i can add row at run time
one more question
if i want to delete row particular row of grid how to do that.
Pls try for ms form2 combo box also

thanx
 
You need to delete your combo box. Then add a picture box, then add the combo again. Make sure the combo is drawn within the picture box.

Then I use the following code to show the combo on the grid.
Code:
Public Sub Position_PictureCombo(pGrid As MSFlexGrid, pPicture As PictureBox, pBox As MSForms.ComboBox)
'// Position the floating picture box with the combo box on the grid.
   On Error GoTo ERR_PositionPictureCombo
   
   pPicture.top = pGrid.top + pGrid.CellTop 
   pPicture.Left = pGrid.Left + pGrid.CellLeft
   pPicture.width = pGrid.CellWidth
   pPicture.Height = pGrid.CellHeight
   pBox.top = 0
   pBox.Left = 0
   pBox.width = pPicture.width
   pBox.Height = pPicture.Height
   pBox.ZOrder 0
   pPicture.Visible = True
   pBox.Visible = True
   If pBox.Enabled Then pBox.SetFocus
   Exit Sub
   
ERR_PositionPictureCombo:
   ErrorMessenger Err.Number, Err.Description, "modGeneral.Position_PictureCombo", "General Error"
End Sub
Basically you are placing the picture box on the grid and not the combo box. The combo box shows up because it is within the picture box.

BTW, ErrorMessenger is a separate procedure used to display error messages. You will need to replace this.



zemp
 
Thnx u r code works nicely
one more thing how can i delete particular row of grid

thnx again
 
pitamber, don't forget to click on that link that says Thank zemp for this valuable post! and award him a star for his valuable post:)


Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Deleting a row will depend on how you are connecting the grid to the data (bound vs unbound).

zemp
 
Zemp,I am using unbound data in grid.
Pls. tell me how can i delete the particular row


thnx
pitamber
 
The method I use is to clear and reload the grid without the 'deleted' row. If you clear remember to reset the .formatstring for fixed rows or columns.

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top