Results 1 to 6 of 6

Thread: help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    /root/usr/local/bin
    Posts
    476

    help

    i tried but it doesn't work
    Code:
    Private Sub MoveCombo()
    ' In case of error, hide the ComboBox.
    On Error GoTo Error_Handler
    Dim gcol As MSDataGridLib.Column
    Set gcol = DataGrid1.Columns(DataGrid1.col)
    
    If gcol.Caption = "fieldname" And DataGrid1.CurrentCellVisible Then
    ' Move the ComboBox inside the column
    ' if it is the current column and it is visible.
    combo1.Move DataGrid1.Left + gcol.Left, _
    DataGrid1.Top + DataGrid1.RowTop(DataGrid1.row), gcol.Width
    combo1.ZOrder
    combo1.SetFocus
    DataGrid1.RowHeight = combo1.Height
    combo1.Text = gcol.Text
    Exit Sub
    End If
    Error_Handler:
    ' In all other cases, hide the ComboBox.
    combo1.Move _10000
    If DataGrid1.Visible Then DataGrid1.SetFocus
    End Sub
    
    on the combobox
    Private Sub combo1_Click()
    ' Change the value of the underlying grid cell.
    DataGrid1.Columns("fieldname").Value = _
    combo1.ItemData(combo1.ListIndex)
    End Sub
    
    then add the sub on the ff events of the datagrid
    Private Sub DataGrid1_RowColChange(LastRow As Variant, _
    ByVal LastCol As Integer)
    MoveCombo
    End Sub
    
    Private Sub DataGrid1_RowResize(Cancel As Integer)
    MoveCombo
    End Sub
    
    Private Sub DataGrid1_ColResize(ByVal ColIndex As Integer, _
    Cancel As Integer)
    MoveCombo
    End Sub
    
    Private Sub DataGrid1_Scroll(Cancel As Integer)
    MoveCombo
    End Sub
    
    Private Sub DataGrid1_SplitChange()
    MoveCombo
    End Sub
    *****************
    VB6,PHP,VS 2005

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    /root/usr/local/bin
    Posts
    476

    Re: help

    i attached class module, how to use it correctly?
    why it didn;t work? what's missing?
    Code:
    Private Sub DataGrid1_MouseMove(Button As Integer, Shift As Integer, _
                                      X As Single, Y As Single)
     Dim a As ComboWithGrid
     Set a = New ComboWithGrid
     a.SetComboOnGrid Combo1, DataGrid1, 1, True
    End Sub
    Attached Files Attached Files
    *****************
    VB6,PHP,VS 2005

  3. #3
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: help

    can you tell what doesnt work please?
    What does this code do?
    Whats the Error?


    IIF(Post.Rate > 0 , , )

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: help

    "It doesn't work" doesn't mean anything. We need specifics.

    What is it doing and what should it be doing?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    /root/usr/local/bin
    Posts
    476

    Re: help

    the class module will integrate combobox in a datagrid column
    the sub setComboOnGrid function is the key
    the am i calling the procedure is it correct?
    *****************
    VB6,PHP,VS 2005

  6. #6
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: help

    See this
    http://codeguru.earthweb.com/forum/s...75&postcount=7
    http://codeguru.earthweb.com/forum/s....php?p=1699207



    BTW the member who made the post is still there. Try PM him on that forum. Or post a new thread there.
    IIF(Post.Rate > 0 , , )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width