Page 1 of 2 12 LastLast
Results 1 to 40 of 44

Thread: ucGridPlus

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Post ucGridPlus

    A new UserControl or ocx (for those who want to compile it), as its name implies, is a Grid. Although there are already some Grids and very good by the way, in this case I tried to find a more modern side, I had never used this control so I went based on the different options that are on the web, both those of vb6 (LynxGrid, IGrid, VBFlexGrid) such as those for web use for example ComponentOne and DevExpress. This control took me a long time since there are many lines of code, as always I have not made any help file, but within the examples you will find some very functional examples in real time. Being a control with many options, surely many things have escaped me, which I will be able to add or correct if they let me know, something that I could not do in this grid was to implement the MergedCell functionality (combined cells), but the rest I think is almost everything.

    One problem that I found late was that for aesthetic reasons I used another usercontrol "ucScrollBar" as I had already done in the ucList, but I had not noticed that if the project name is changed the ucScrollBar loses the reference and becomes a PictureBox To prevent this from happening, it is necessary to open the ucGridPlus with the notepad and change "Project1" to the name of the project in which it is going to be used, at the moment I did not find a better solution.

    The control can load images in many forms and formats both ColImgListAddImage and HeaderImgListAddImage can load the image from array of bits, file, url, base64 url, hbitmap, hIcon and stream; The images can be treated as vectors where we can assign the color according to the forecolor of the cell or we can put common images, it also has a "radius" property to give a circular shape or with rounded tips.

    In the first example you will find some graphs, Progress and ranking that are shown in each row, in those examples I used an external module to use a CustomDraw, this with the appropriate knowledge you can do infinite things. It is not part of the grid itself, in this way it is easier to do things according to each one's needs.

    In the case of the controls, it is the same, they are not part of the grid, the ucGridPlus is a container, where we can put Combobox, Datepiker among others and with some properties of this we can place said controls on the cell simulating that they are part of she.

    The grid has the possibility of adding events to the images and text of the cell, in this way some nice effects can be achieved as you will see in the examples.

    It is necessary to have the "Segoe MDL2 Assets" font installed in windows 10, it is already by default, it was used for some icons.

    For compiled version (OCX) use the UniTextBox user control to accept unicode characters in edit mode.

    To close I want to clarify that this is at the moment something like a beta and until it is not used and errors are found I will not be able to detect them, I know that many things were left in the inkwell but for now I ran out of energy.





    DOWNLOAD USERCONTROL AND EXAMPLES
    ucGridPlus.zip

    FOR DOWNLOAD COMPILE VERSION(OCX) AND MORE SCREENSHOTS
    http://leandroascierto.com/blog/gridplus/


    Code:
    '29/09/21 V:1.0.1
    'Fixed Column sort, only left button, no sort when draw column.
    'Fixed when a row was resize the scrollbar did not show last rows.
    'Fixed error column sort when not rows
    
    '01/10/21 V: 1.0.2  Thank you Elihu !!
    Fixed Visual error if the scroll value was greater than the Maximum, a direct call was also added within the Scroll that caused a delay due to the timerVB
    The selection can now be made with the right button, if you right click within the range selected the selection is not lost, especially for a PopUpMenu.
    'Button', 'Shift' parameters were added in the CellClick, LabelMouseDown, LabelMouseUp, ImgMouseDown, ImgMouseUp events, the BorderWidth property
    was added and the BorderVisible property was removed, an error in the border color was also corrected.
    ShowHotColumn property added (to highlight the columns under the cursor)
    In the OCX version in the uniTextBox the detection of the keyboard arrows was corrected (NO IPAO)
    '11/10/21 V:1.0.3
        'Added a lot of changes and fix, I can't remember which ones anymore
        'Added all events and property referring to Drag And Drop
        'Improvements in reading bmp and Icon images with 32-bit alpha channel
        'improved the function AutoWidthColumn
        'Added ColSort and ColSortOrder property to be able to sort by sql
    '15/11/21 V:1.0.4
        'changes made by jpbro (vbforum), behavior in the text box when moving the keyboard arrows,
        'and added BeforeEdit event (Thanks)
    '23/12/2021 V:1.0.5
        'fixed if the fixedrow row has a greater height than the rest of the rows, when clicking on a cell, the one in the next row is highlighted
    '29/01/2022  V:1.0.6
        'Added Propertys ShowHotRow, HeaderTextWordBreak, GradientStyle, GetTopRow and GetVisibleRows
    
    '08/11/2022 Last Update
    '----------------------
    Last edited by LeandroA; Nov 8th, 2022 at 06:34 PM.
    leandroascierto.com Visual Basic 6 projects

  2. #2
    Lively Member
    Join Date
    Sep 2016
    Posts
    94

    Re: ucGridPlus

    Congratulations Leandro,
    This project is the answer to all my expectations.
    Everything I had hoped to see one day has come true !

  3. #3

  4. #4
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: ucGridPlus

    BUG problem found:
    Double-click the cell with the mouse, and then click to other cells after modification, the data modification fails.
    If you press Enter after the modification, the modification will take effect.

    The ranking field, the attribute of the five-pointed star, the default yellow color, if the default is 3 stars, the 4 stars will light up when the mouse is moved up. It would be better if three colors could be used.
    3 stars are currently selected, and the mouse moves to the 4th star to display blue or other colors.

    The fields of the drop-down list now need to click the small arrow mark on the right side of the middle cell. Is there a way to double-click the cell to pop up the drop-down options?
    Last edited by xiaoyao; Sep 28th, 2021 at 07:56 AM.

  5. #5
    Member
    Join Date
    Jan 2018
    Posts
    32

    Re: ucGridPlus

    Excellent work

  6. #6
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    506

    Re: ucGridPlus

    good job

  7. #7
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: ucGridPlus

    Nice grid
    but when having several monitors, and running it on another monitor than the principal, it has some problems of display (the same for the listbox control)
    The position is not at the right place

  8. #8
    New Member
    Join Date
    Feb 2014
    Posts
    5

    Re: ucGridPlus

    You've done an outstanding job!

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by Thierry69 View Post
    Nice grid
    but when having several monitors, and running it on another monitor than the principal, it has some problems of display (the same for the listbox control)
    The position is not at the right place
    Oooo ****! Can you send me a screenshot, can you tell me what is the dpi of each monitor? this happens compiled or from the ide?
    leandroascierto.com Visual Basic 6 projects

  10. #10
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Re: ucGridPlus

    Here is a sample (I have 5 screens, DPI normal)
    Attachment 182441

  11. #11
    Member
    Join Date
    Jan 2021
    Posts
    55

    Re: ucGridPlus

    Excelente! Tus UC me ayudaron mucho!!!

    Lástima que el Whatsapp ya no sirve y no se cuales son los ID de los divs para modificar

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by xiaoyao View Post
    BUG problem found:
    Double-click the cell with the mouse, and then click to other cells after modification, the data modification fails.
    If you press Enter after the modification, the modification will take effect.
    I think it is the most correct, the user must press enter or an arrow to confirm the changes

    Quote Originally Posted by xiaoyao View Post
    The ranking field, the attribute of the five-pointed star, the default yellow color, if the default is 3 stars, the 4 stars will light up when the mouse is moved up. It would be better if three colors could be used.
    3 stars are currently selected, and the mouse moves to the 4th star to display blue or other colors.
    that does not belong to the grid, it is a custom draw of an external module, it is a detail that can be corrected.

    Quote Originally Posted by xiaoyao View Post
    The fields of the drop-down list now need to click the small arrow mark on the right side of the middle cell. Is there a way to double-click the cell to pop up the drop-down options?
    Depending on the occasion, you might want to edit it manually without requiring an element from the list, for this example I decided to show the click event of the image, but it is very easy with these lines

    Code:
    Private Sub ucGridPlus1_CellClick(ByVal lRow As Long, ByVal lCol As Long)
        If ucGridPlus1.ColRef(lCol) = 5 Then
            ucGridPlus1_ImgMouseUp lRow, lCol
        End If
    End Sub
    thanks for your report
    leandroascierto.com Visual Basic 6 projects

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by Thierry69 View Post
    Here is a sample (I have 5 screens, DPI normal)
    Attachment 182441
    Please could you upload the screenshot again the attachment was lost
    leandroascierto.com Visual Basic 6 projects

  14. #14

  15. #15
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: ucGridPlus

    If you add an attribute: double-click to automatically pop up a drop-down list, which is much more convenient for ordinary users.
    For example, clicking another cell after the cell modification is completed will automatically modify the content of the previous cell (no need to press Enter to confirm)
    It is much more convenient to add these 2 control properties (true/false)

    Code:
    Private Sub ucGridPlus1_CellClick(ByVal lRow As Long, ByVal lCol As Long)
        If ucGridPlus1.ColRef(lCol) = 5 Then
            ucGridPlus1_ImgMouseUp lRow, lCol
        End If
    End Sub

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    New Update and new examples

    Small example of a file explorer (not unicode, not big file size, just a small example to show drag & drop of files.)

    Drag & Drop in grids
    Last edited by LeandroA; Oct 11th, 2021 at 04:34 PM.
    leandroascierto.com Visual Basic 6 projects

  17. #17

  18. #18
    Lively Member
    Join Date
    Sep 2016
    Posts
    94

    Re: ucGridPlus

    Hi Leandro,
    Missing property: HeaderFont Forecolor

    Congratulations

  19. #19
    Lively Member
    Join Date
    Sep 2016
    Posts
    94

    Re: ucGridPlus

    my apologies Leandro I was blind !

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by darjeeling View Post
    Hi Leandro,
    Missing property: HeaderFont Forecolor



    Congratulations

    hello, this one but with another name, perhaps yours was more intuitive, there is no general property since the font is white or black to automatically contrast according to its backcolor

    column 2
    Code:
    ucGridPlus1.ColHeaderForeColor(2) = vbRed
    or all header

    Code:
    Dim i As Long
    For i = 0 To ucGridPlus1.ColsCount - 1
        ucGridPlus1.ColHeaderForeColor(i) = vbRed
    Next
    Tanks!
    leandroascierto.com Visual Basic 6 projects

  21. #21
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: ucGridPlus

    Hi Leandro,

    This is a very nice project, thank you for releasing it to the community.

    I had a need for some features that aren't provided by the grid at the moment. I was able to implement them myself, but I thought I would pass them on to you in case you want to include them.

    First, I needed a BeforeEdit event:

    Code:
    Public Event BeforeEdit(ByVal lRow As Long, ByVal lCol As Long, ByVal vValue As Variant, ByRef bCancel As Boolean)
    The Cancel parameter allows the host to prevent editing of a cell that would otherwise be allowed by the "Row/ColEdition" properties.

    In some case you want to disallow cell editing based on dynamic criteria, and the BeforeEdit event makes this possible.

    Second, I wanted to allow vbSpace to toggle checkbox cells to match user's expectations with other checkbox controls.

    Lastly, I wanted to allow the F2 key to start editing cells, again to match user's expectations with other controls.

    I edited the code as follows:

    The UserControl_KeyPress event now looks like this:

    Code:
    Private Sub UserControl_KeyPress(KeyAscii As Integer)
        ' Pass KeyAscii=0 to start edit a cell (where allowed) without raising keypress events
    
        Dim bCancel As Boolean
        
        If KeyAscii <> 0 Then RaiseEvent KeyPress(KeyAscii)
        
        If Not IsPointEmpty(SelCel) Then
            If mCol(SelCel.X).DataType = GP_BOOLEAN Then 'if is Boolean click
                Select Case KeyAscii
                Case vbKeySpace, vbKeyReturn
                    RaiseEvent BeforeEdit(SelCel.Y, SelCel.X, mRow(SelCel.Y).Cells(SelCel.X).Value, bCancel)
                    If Not bCancel Then
                        mRow(SelCel.Y).Cells(SelCel.X).Value = Not mRow(SelCel.Y).Cells(SelCel.X).Value
                        Draw
                        RaiseEvent AfterEdit(SelCel.Y, SelCel.X, Not mRow(SelCel.Y).Cells(SelCel.X).Value)
                    End If
                End Select
                Exit Sub
            Else
                If KeyAscii = vbKeyReturn Then Exit Sub 'Filter Key Enter
                If KeyAscii = vbKeyBack Then KeyAscii = 0
            End If
            If mRow(PtrRow(SelCel.Y)).IsGroup = True Then Exit Sub
            If mRow(PtrRow(SelCel.Y)).IsFullRow = True Then Exit Sub
            
            If mCol(PtrCol(SelCel.X)).EditionLocked = False Then
                If mRow(PtrRow(SelCel.Y)).Cells(PtrCol(SelCel.X)).EditionLocked = False Then
                    CellStartEdit SelCel.Y, SelCel.X
                    If KeyAscii <> 0 Then
                        Text1.Text = Chr(KeyAscii)
                        Text1.SelStart = Len(Text1.Text)
                    End If
                End If
            End If
        End If
    End Sub
    The UserControl_MouseUp event now looks like this:

    Code:
    Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Dim R As Rect, R2 As Rect, vOldValue As Variant
        Dim bCheckRow As Boolean, bText As Boolean, bImage As Boolean
        Dim i As Long
        Dim mTemp As Long
        Dim HotCell As POINTAPI
        Dim Cel As POINTAPI
        Dim bCancel As Boolean
        
        SizeColumn.CurColumn = -1
        SizeColumn.CurRow = -1
        Timer1.Interval = 0
            
        If mColDrag.X > -1 Then
            mColDrag.X = -1
            If mColDrag.DestCol > -1 Then
                mTemp = PtrCol(mColDrag.SrcCol)
                If mColDrag.DestCol < mColDrag.SrcCol Then
                    For i = mColDrag.SrcCol To mColDrag.DestCol + 1 Step -1
                        PtrCol(i) = PtrCol(i - 1)
                    Next
                Else
                    For i = mColDrag.SrcCol To mColDrag.DestCol - 1
                        PtrCol(i) = PtrCol(i + 1)
                    Next
                End If
                PtrCol(mColDrag.DestCol) = mTemp
                If m_SelectionMode <> GP_SelByMultiRow And m_SelectionMode <> GP_SelBySingleRow Then
                    SelCel.X = mColDrag.DestCol
                    SelRange.Start.X = mColDrag.DestCol
                    SelRange.End.X = mColDrag.DestCol
                End If
                Draw
                RaiseEvent AfterColumnDrag(mColDrag.DestCol)
                GoTo EventMouseUp
            End If
        End If
        
        'Cell checkbox
        If PvGetHotCell(X, Y, HotCell, R) Then
            IsMouseInCellPart HotCell.Y, HotCell.X, X, Y, bCheckRow, bText, bImage
            
            If bCheckRow Then
                SetCursor hCurHands
                mRow(PtrRow(HotCell.Y)).Checked = Not mRow(PtrRow(HotCell.Y)).Checked
                m_AllRowAreCheked = True
                For i = 0 To m_RowsCount - 1
                    If mRow(PtrRow(i)).Checked = False Then
                        m_AllRowAreCheked = False
                        Exit For
                    End If
                Next
                Draw
                GoTo EventMouseUp
            End If
            
            If (bText And mCol(PtrCol(HotCell.X)).LabelsEvents) Or (bText And mCol(PtrCol(HotCell.X)).DataType = GP_BOOLEAN) Then
                
                If mCol(PtrCol(HotCell.X)).DataType = GP_BOOLEAN And Not mCol(PtrCol(HotCell.X)).EditionLocked And m_AllowEdit Then
                    RaiseEvent BeforeEdit(HotCell.Y, HotCell.X, mRow(PtrRow(HotCell.Y)).Cells(PtrCol(HotCell.X)).Value, bCancel)
                    If bCancel Then GoTo EventMouseUp
                    
                    If mRow(PtrRow(HotCell.Y)).Cells(PtrCol(HotCell.X)).EditionLocked = False Then
                        SetCursor hCurHands
                        With mRow(PtrRow(HotCell.Y)).Cells(PtrCol(HotCell.X))
                            vOldValue = .Value
                            If IsNull(.Value) Then
                                .Value = True
                            Else
                                .Value = Not .Value
                            End If
                        End With
                        Draw
                        RaiseEvent AfterEdit(HotCell.Y, HotCell.X, vOldValue)
                    End If
                Else
                    SetCursor hCurHands
                    RaiseEvent LabelMouseUp(HotCell.Y, HotCell.X, Button, Shift)
                End If
               
            End If
            
            If bImage And mCol(PtrCol(HotCell.X)).ImagesEvents Then
                SetCursor hCurHands
                RaiseEvent ImgMouseUp(HotCell.Y, HotCell.X, Button, Shift)
            End If
        End If
        
        If Y < m_HeaderHeight And m_HeaderHeight > 0 Then
            If IsHotColCheckBox(HotCol, X, Y) Then
                m_AllRowAreCheked = Not m_AllRowAreCheked
                For i = 0 To m_RowsCount - 1
                    mRow(PtrRow(i)).Checked = m_AllRowAreCheked
                Next
                Draw
                GoTo EventMouseUp
            End If
        
             '// Sort requested from Column Header click
             If (HotCol <> C_NULL_RESULT) And (SizeColumn.HotColumn = C_NULL_RESULT) And Button = vbLeftButton Then
                If m_AllowColumnSort Then
                   If (Shift And vbCtrlMask) And Not (mSortColumn = -1) Then
    '                  If Not (mSortSubColumn = PtrCol(HotCol)) Then
    '                     mCol(PtrCol(HotCol)).nSortOrder = lgSTNormal
    '                  End If
    
                      'mSortSubColumn = HotCol
                      Sort mSortColumn, mCol(mSortColumn).nSortOrder, PtrCol(HotCol) ', mCol(PtrCol(mSortColumn)).nSortOrder
    
                   Else
                      If Not (mSortColumn = PtrCol(HotCol)) Then
                         mCol(PtrCol(HotCol)).nSortOrder = lgSTNormal
                         mSortSubColumn = -1
                      End If
    
                      'mSortColumn = HotCol
                      If Not (mSortSubColumn = -1) Then
                         Sort , , , mCol(PtrCol(mSortSubColumn)).nSortOrder
                      Else
                         Sort PtrCol(HotCol)
                      End If
                   End If
    
                   Draw
                End If
             End If
             If HotCol <> -1 Then
                RaiseEvent ColumnClick(HotCol, Button, Shift)
             End If
        End If
        
        'Click in Group Button
        If PvGetHotCell(X, Y, Cel, R) And eSelBy = SelectByCells Then
            RaiseEvent CellClick(Cel.Y, Cel.X, Button, Shift)
        End If
    
        If PvGetHotCell(m_RowSelectorWidth + 1, Y, Cel, R) Then
            If Button = vbLeftButton Then
                If mRow(PtrRow(Cel.Y)).IsGroup = True Then
                    With R2
                        .Left = Margin + (20 * DpiF * mRow(PtrRow(Cel.Y)).Ident)
                        .Top = (R.Bottom - R.Top) / 2 - 8 * DpiF
                        .Right = .Left + 16 * DpiF
                        .Bottom = .Top + 16 * DpiF
                    End With
                    
                    If PtInRect(R2, X - R.Left, Y - R.Top) Then
                        If mRow(PtrRow(Cel.Y)).IsGroupExpanded Then
                            GroupColapse Cel.Y
                        Else
                            GroupExpand Cel.Y
                        End If
                    End If
                End If
            End If
        End If
        
    EventMouseUp:
        RaiseEvent MouseUp(Button, Shift, X, Y)
    End Sub
    I added the following to the UserControl_KeyDown code:

    Code:
            Case vbKeyF2
                UserControl_KeyPress 0  ' Send KeyAscii 0 to start cell editing when it is allowed
    That code is in the Select Case KeyCode block, right before testing for "Case vbKeyRight".

    Thanks again, and feel free to ignore this post if you aren't interested in making the suggested changes.

  22. #22
    Addicted Member jg.sa's Avatar
    Join Date
    Nov 2017
    Location
    South Australia ( SA )
    Posts
    198

    Re: ucGridPlus

    G'Day Bro

    I though you we going to sleep !!!

    Did you stay up to watch Vales last race ?

    What is so spooky his racing number "was" ( now using past tense ) 46 = 14 + 11 + 21 -> 14th Oct 2021 his last race


    Quote Originally Posted by jpbro View Post
    This is a very nice project, thank you for releasing it to the community.
    +1 from me

    Quote Originally Posted by jpbro View Post
    I had a need for some features that aren't provided by the grid at the moment.
    I know how you feel, can you migrate this to port 80 so we can weave this into -> https://www.vbforums.com/showthread....ite-App-Server ?

  23. #23
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: ucGridPlus

    Hi Leandro,

    I bumped into a couple of additional issues that I was able to fix, so I thought I'd pass the changes on:

    1) Pressing ESC in a cell will insert a box character.

    2) Starting typing in a cell will select the inserted character, so subsequent typing will remove the character you were expecting to start your cell value with. e.g. quickly typing "test" will result in the cell text being "est"

    3) Pressing Left/Right arrow keys will stop editing a cell when the user likely just wants to move the caret.

    4) Pressing the Delete key does nothing. It would be nice if it would edit the cell (if allowed) and clear the contents.

    To address the above, I suggest the following changes:

    1) Remove Text1_GotFocus

    2) Change the vbKeyLeft and vbKeyRight tests in Text1_KeyDown to prevent moving off the cell when there is a selection or when the caret isn't at the beginning or end of the text:

    Code:
            Case vbKeyRight: If Text1.SelStart = Len(Text1.Text) Then If Text1.SelLength = 0 Then mPT.X = mPT.X + 1: bUpdate = True
            Case vbKeyLeft: If Text1.SelStart = 0 Then If Text1.SelLength = 0 Then mPT.X = mPT.X - 1: bUpdate = True
    3) Prevent non-printable characters from being inserted into the TextBox (e.g. Escape), add the following code to UserControl_KeyPress right after the test for vbKeyBack:

    Code:
                If KeyAscii > 0 And KeyAscii < 32 Then Exit Sub
    4) Allow DELETE key to delete contents on edit. Add the following to UserControl_KeyDown in the Select Case Keycode test block:

    Code:
            Case vbKeyDelete
                UserControl_KeyPress -1    ' Delete contents on edit
    And Change the UserControl_KeyPress code ater the CellStartEdit call to this:

    Code:
                    Select Case KeyAscii
                    Case Is > 0  
                        ' Insert typed character and move caret to end of text
                        Text1.Text = Chr(KeyAscii)
                        Text1.SelStart = Len(Text1.Text)
                    Case -1 
                        ' Delete contents
                        Text1.Text = ""
                    End Select

  24. #24
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: ucGridPlus

    @jg.sa When you have a <2 year old, hours of sleep can be a highly variable number As for the race, I don't really know anything about racing. I'm a hockey fan.

    Regarding porting this grid to the web, I don't think there's much that could be shared between Leandro's code and an HTML/JS implementation that would be suitable for web browsers. The good news is that there are plenty of free & open source HTML/JS grids out there. I'm not the best person to ask about them though, as I haven't had much use for one yet (though I suspect I will in my next project, so perhaps I'll have a recommendation one day soon).

  25. #25
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: ucGridPlus

    Leandro - I had to make a few more tweaks so the editing behaviour worked as expected. Since there have been quite a few changes, I figured it would be easier to post the entire modified ucGridPlus.ctl (attached below). If you'd like to see exactly what I changed, you can use a tool like WinMerge to compare my version with yours. Of course, it's entirely up to you if you wish to use the modifications.

    ucGridPlusJPB.zip

  26. #26

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by jpbro View Post
    Leandro - I had to make a few more tweaks so the editing behaviour worked as expected. Since there have been quite a few changes, I figured it would be easier to post the entire modified ucGridPlus.ctl (attached below). If you'd like to see exactly what I changed, you can use a tool like WinMerge to compare my version with yours. Of course, it's entirely up to you if you wish to use the modifications.

    ucGridPlusJPB.zip

    Thank you very much, very good changes, it has already been updated,
    Note: In the ocx version, I still cannot find how to implement it because it does not implement detection of the keys arrows in UniTextBox.ctl
    leandroascierto.com Visual Basic 6 projects

  27. #27
    New Member
    Join Date
    Nov 2021
    Posts
    3

    Re: ucGridPlus

    Leandro, thanks for the great control!
    Sorry for the possibly inappropriate question, but does this control work on Windows XP? I was unable to start it.

  28. #28
    Addicted Member jg.sa's Avatar
    Join Date
    Nov 2017
    Location
    South Australia ( SA )
    Posts
    198

    Re: ucGridPlus

    No, but it works on Windows 3.12 -

    Sorry, Southern Hemisphere Support Guy Humor !!!

  29. #29

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by jtd2021 View Post
    Leandro, thanks for the great control!
    Sorry for the possibly inappropriate question, but does this control work on Windows XP? I was unable to start it.
    uff XP?, I have not tested it, I do not use anything weird, but hey xp has its things that should be treated differently so I do not give any guarantee that it works.
    leandroascierto.com Visual Basic 6 projects

  30. #30

  31. #31

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Update 1.0.6
    '29/01/2022
    'Added Propertys ShowHotRow, HeaderTextWordBreak, GradientStyle, GetTopRow and GetVisibleRows
    leandroascierto.com Visual Basic 6 projects

  32. #32
    New Member
    Join Date
    Aug 2019
    Posts
    6

    Re: ucGridPlus

    Hello, Leandro, greate work! I try to use your control in my new project and found strange behavior. When setting scrollbars theme to "sThemed", in IDE scrollbars look as expected, but after compiling they became unthemed. I attached two images, first one is your compiled example, second one is mine, as you can see left tree has themed scrollbars (app has manifest).
    Name:  001.png
Views: 1918
Size:  11.7 KBName:  002.jpg
Views: 1906
Size:  31.1 KB
    Attached Images Attached Images  

  33. #33

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by NotAlex View Post
    Hello, Leandro, greate work! I try to use your control in my new project and found strange behavior. When setting scrollbars theme to "sThemed", in IDE scrollbars look as expected, but after compiling they became unthemed. I attached two images, first one is your compiled example, second one is mine, as you can see left tree has themed scrollbars (app has manifest).
    Name:  001.png
Views: 1918
Size:  11.7 KBName:  002.jpg
Views: 1906
Size:  31.1 KB
    Hello Thanks for reporting, I had not paid much attention to the scroll code, there are some things to correct so I put this error is due to a bad verification of the version of the OS, you can correct this by commenting the following line inside the pvCheckEnvironment routine of usercontrol ucScrollbar "'If (.dwMinorVersion > 0) Then"

    the routine should be like this

    Code:
    Private Sub pvCheckEnvironment()
        'modified by Jason James Newland 2007
        Dim uOSV As OSVERSIONINFO
        '
        m_bIsXP = False
        m_bIsLuna = False
        
        With uOSV
            .dwOSVersionInfoSize = Len(uOSV)
            Call GetVersionEx(uOSV)
            Form1.Caption = .dwMinorVersion
            If (.dwPlatformId = 2) Then
                If (.dwMajorVersion >= 5) Then    ' NT based
                    'If (.dwMinorVersion > 0) Then ' XP
                        m_bIsXP = True
                        m_bIsLuna = pvIsLuna()
                    'End If
                End If
            End If
        End With
        
    End Sub
    In the next version I will also remove this check since this grid would not work on OS prior to Win XP
    leandroascierto.com Visual Basic 6 projects

  34. #34
    New Member
    Join Date
    Aug 2019
    Posts
    6

    Re: ucGridPlus

    Quote Originally Posted by LeandroA View Post
    Hello Thanks for reporting, I had not paid much attention to the scroll code, there are some things to correct so I put this error is due to a bad verification of the version of the OS, you can correct this by commenting the following line inside the pvCheckEnvironment routine of usercontrol ucScrollbar "'If (.dwMinorVersion > 0) Then"

    the routine should be like this

    Code:
    Private Sub pvCheckEnvironment()
        'modified by Jason James Newland 2007
        Dim uOSV As OSVERSIONINFO
        '
        m_bIsXP = False
        m_bIsLuna = False
        
        With uOSV
            .dwOSVersionInfoSize = Len(uOSV)
            Call GetVersionEx(uOSV)
            Form1.Caption = .dwMinorVersion
            If (.dwPlatformId = 2) Then
                If (.dwMajorVersion >= 5) Then    ' NT based
                    'If (.dwMinorVersion > 0) Then ' XP
                        m_bIsXP = True
                        m_bIsLuna = pvIsLuna()
                    'End If
                End If
            End If
        End With
        
    End Sub
    In the next version I will also remove this check since this grid would not work on OS prior to Win XP
    Perfect, it works as needed. Thanx!

  35. #35
    New Member
    Join Date
    Aug 2019
    Posts
    6

    Re: ucGridPlus

    Perfect, works as needed. Thanx!

  36. #36
    Junior Member
    Join Date
    Aug 2006
    Posts
    24

    Re: ucGridPlus

    good very good

  37. #37
    Addicted Member
    Join Date
    Mar 2009
    Posts
    244

    Re: ucGridPlus

    WOW, this is an excellent grid and the performance is also very good.

    A good addition would be to be able to add columns through the IDE so you don't have to create it through code for most grids.

  38. #38
    Junior Member
    Join Date
    Jul 2020
    Posts
    23

    Re: ucGridPlus

    Crash when double clicking on a column header if there are no records.

    Code:
        
    With GridRegister
            .Clear True
            .Redraw = False
            .HeaderHeight = 40
            .RowSelectorWidth = 0
            .RowsHeight = 30
            .ColsCount = 5
            
            .ColumnText(0) = "Col 1"
            .ColumnText(1) = "Col 2"
            .ColumnText(2) = "Col 3"
            .ColumnText(3) = "Col 4"
            .ColumnText(4) = "Col 5"
            
            For i = 0 To .ColsCount - 1
                .ColEditionLocked(i) = True
                .ColDataType(i) = GP_STRING
                .ColAlign(i) = CenterCenter
            Next i
    
            .AutoWidthAllColumns
            
            .AllowColumnDrag = False
            .AllowRowsResize = False
            .AllowColumnSort = True
            .AllowEdit = False
            
            .Redraw = True
        End With
    Sorry, I can't attach an image to the body of the post. On sreenshot - Subscript out of range. Row = 0

    Attachment 186171
    Last edited by Visualman; Nov 8th, 2022 at 03:01 PM.

  39. #39

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2008
    Location
    Argentina
    Posts
    439

    Re: ucGridPlus

    Quote Originally Posted by Visualman View Post
    Crash when double clicking on a column header if there are no records.
    Hi, download the latest version it was already fixed (08/11/2022)
    leandroascierto.com Visual Basic 6 projects

  40. #40
    Junior Member
    Join Date
    Jul 2020
    Posts
    23

    Re: ucGridPlus

    Quote Originally Posted by LeandroA View Post
    Hi, download the latest version it was already fixed (08/11/2022)
    Thank you! I made the same fix.

Page 1 of 2 12 LastLast

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