Page 21 of 34 FirstFirst ... 111819202122232431 ... LastLast
Results 801 to 840 of 1324

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #801
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Is there a "test suite" for VbFlecGrid, which use all properties/methods? I though that this will be as a reference for those who want to get the most from this control.

  2. #802

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    Included the ShowScrollTips feature. The feature is most useful when the ScrollTrack property is set to False.
    The demo project is updated to demonstrate usage of the ScrollTip event.
    Code:
    Private Sub VBFlexGrid1_ScrollTip(ByVal Row As Long, ByVal Col As Long)
    If Row > -1 Then
        VBFlexGrid1.ScrollTipText = "Row " & VBFlexGrid1.TextMatrix(Row, 0)
    ElseIf Col > -1 Then
        VBFlexGrid1.ScrollTipText = "Column " & VBFlexGrid1.TextMatrix(0, Col)
    End If
    End Sub
    If you prefer that the scroll tip follows the thumb as the user scrolls set the ScrollTipFollowThumb property to True.

  3. #803
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I'd love to have a property that shows the status of the scrollbars, e.g. isScrollbarvisible = vbSBNone, vbBoth etc.
    While the state of the scrollbar can be calculated by the app, the data is already in the grid, so why not make it easy.
    Another issue is the behavior with many rows and sorting. It should be a doEvent (or maybe an other solution) to prevent the app from showing a non responding window titlebar. A grid with 60k records or more can freeze for minutes, and the user may not know that the sorting is still active and press repeatedly keys or clicks close.
    I solved this in my private version of the grid with a property HandleDoEvents()= True or False to allow the grid a DoEvents while sorting or not.

    Code:
    '*Seniorchef
    Public Property Get HandleDoEvents() As Boolean
       HandleDoEvents = PropDoEvents
    End Property
    
    Public Property Let HandleDoEvents(ByVal Value As Boolean)
    PropDoEvents = Value
    UserControl.PropertyChanged "HandleDoevents"
    End Property
    '*End Seniorchef
    
    Private Sub MergeSortRec(ByVal Left As Long, ByVal Right As Long, ByVal Col As Long, ByRef Data() As TCOLS, ByVal Sort As FlexSortConstants)
    Dim Middle As Long
    Static xTimer As Single
    Middle = (Left + Right) \ 2
    
    If Left < Right Then
        Call MergeSortRec(Left, Middle, Col, Data(), Sort)
        Call MergeSortRec(Middle + 1, Right, Col, Data(), Sort)
        Call InplaceMergeSort(Left, Middle, Right, Col, Data(), Sort)
        '*Seniorchef
        'Every 250 ms a Doevents() to Prevent not respondig Control
        If PropDoEvents Then
          If Timer - xTimer > 0.25 Then
             DoEvents
             xTimer = Timer
          End If
       End If
       '*End Seniorchef
    End If
    End Sub
    Maybe the property HandleDovents() stores an intervall of milliseconds instead of a boolean value, where 0 disables DoEvents.
    Of course, the calling app has to ensure that nothing weird happens while the grid processes its doEvents.

  4. #804

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Seniorchef View Post
    I'd love to have a property that shows the status of the scrollbars, e.g. isScrollbarvisible = vbSBNone, vbBoth etc.
    While the state of the scrollbar can be calculated by the app, the data is already in the grid, so why not make it easy.
    Another issue is the behavior with many rows and sorting. It should be a doEvent (or maybe an other solution) to prevent the app from showing a non responding window titlebar. A grid with 60k records or more can freeze for minutes, and the user may not know that the sorting is still active and press repeatedly keys or clicks close.
    I solved this in my private version of the grid with a property HandleDoEvents()= True or False to allow the grid a DoEvents while sorting or not.

    Code:
    '*Seniorchef
    Public Property Get HandleDoEvents() As Boolean
       HandleDoEvents = PropDoEvents
    End Property
    
    Public Property Let HandleDoEvents(ByVal Value As Boolean)
    PropDoEvents = Value
    UserControl.PropertyChanged "HandleDoevents"
    End Property
    '*End Seniorchef
    
    Private Sub MergeSortRec(ByVal Left As Long, ByVal Right As Long, ByVal Col As Long, ByRef Data() As TCOLS, ByVal Sort As FlexSortConstants)
    Dim Middle As Long
    Static xTimer As Single
    Middle = (Left + Right) \ 2
    
    If Left < Right Then
        Call MergeSortRec(Left, Middle, Col, Data(), Sort)
        Call MergeSortRec(Middle + 1, Right, Col, Data(), Sort)
        Call InplaceMergeSort(Left, Middle, Right, Col, Data(), Sort)
        '*Seniorchef
        'Every 250 ms a Doevents() to Prevent not respondig Control
        If PropDoEvents Then
          If Timer - xTimer > 0.25 Then
             DoEvents
             xTimer = Timer
          End If
       End If
       '*End Seniorchef
    End If
    End Sub
    Maybe the property HandleDovents() stores an intervall of milliseconds instead of a boolean value, where 0 disables DoEvents.
    Of course, the calling app has to ensure that nothing weird happens while the grid processes its doEvents.
    Thanks for feedback.
    You can simply use GetWindowLong and check for existence of WS_VSCROLL/WS_HSCROLL.
    If it's there then it's visible. IMO we don't need properties/functions for everything. It's fairly practical in this case.

    About Sort.. well DoEvents is considered as Evil.

    So I could offer a "SortTick" event.
    A new property "SortTimer As Long" would tell the sort function to install a timer before processing with the given value as milliseconds.
    The sorting function then ensures to PeekMessage WM_TIMER internally.
    If SortTimer is 0 (default) it's disabled.

    This way you could make your DoEvents in the SortTick event.
    Is that an idea or stupid?

    EDIT: or better just track GetTickCount inside the sorting and raise SortTick if it's due. I think that is ligher with less overhead.
    Last edited by Krool; Feb 6th, 2023 at 12:03 PM.

  5. #805
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Don't use timer, just raise the event passing two variables, a Cancel and a Skip. Cancel true to stop sorting, and Skip true to not sorting now but command will be in use. So when the list is short, we do not use the event, and always the sort happen. For larger lists let the user handle it. The Skip flag means we have something other in process, so wait until that process end to continue.
    Last edited by georgekar; Feb 7th, 2023 at 01:19 PM.

  6. #806
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thanks for your answers.
    @Krool - you're right, I'm also not a friend of too many "extrawürste". So, ok, I'll try your approach.
    @GeorgeKar - It is not to allow another process to jump in or to stop the sorting, it is to enable the OS to process eg. users keystrokes (ESC) or mouseclicks and show a message without interrupting the sort. Some users tend to press keys all over again because there is no feedback (while the sorting is still in progress) and finally stop the running app with the taskmanager or the "wait or kill?"-query.
    DoEvents is evil - I know. I still use it in certain circumstances, especially to keep the UI alive while processing time consuming subs.
    And it's the only way I know to prevent the app's window from being grayed out by the OS (I'm not a expert in subclassing neither do I know the abyss of the API). Or am I wrong?
    The GetTickCount in conjunction with raiseevent()is a good idea (I tested something similar before I made my first Post, and it didn't work -maybe I missed something).
    I will give it another try and: I'll be back.
    Greetings
    Last edited by Seniorchef; Feb 7th, 2023 at 02:46 AM.

  7. #807
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Ok, I tested the Event - and it works for me.

    I added a RaiseEvent SortTick() and placed a DoEvents in my app in the event handler and Tataa - it's what I need.
    As I don't want to stop the sorting, it is up to you to add a Cancel to the Event. For the sake of completeness it would be better. And a timer for the SortTick would also be convenient.
    Thanks and
    Greetings

  8. #808
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    To not get Gray Window use this:
    Private Declare Sub DisableProcessWindowsGhosting Lib "user32" ()

    At sub main call DisableProcessWindowsGhosting and forget the gray window..
    You say:
    It is not to allow another process to jump in or to stop the sorting, it is to enable the OS to process eg. users keystrokes (ESC) or mouseclicks and show a message without interrupting the sort
    But you have the tools to make not to do anything. Just use events to mark the start and end of the sort and at the "Start mark" disable the form, and enable it at the end (if it is time consuming sort).
    The best for me would be to choose for time consuming work to display a wait message, with pause/cancel buttons, and not allow user to click anything else but the cancel/ pause key.

  9. #809
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    @georgekar - you're right. Honestly, I didn't know the DisableProcessWindowsGhosting, so I will learn to use it. That is a good piece of advice.
    Thanks and greetings

  10. #810
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by georgekar View Post
    To not get Gray Window use this:
    Private Declare Sub DisableProcessWindowsGhosting Lib "user32" ()

    At sub main call DisableProcessWindowsGhosting and forget the gray window..
    ...
    Thanks Georgekar. I have never come across anywhere anybody mentioning about this API so far. Sounds so unique.

    Kind Regards.

  11. #811
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    ... .. . When I tried to increase the 'RowHeight' (say, in 'EditKeyUp' event - of any editable cell, not necessarily ComboEditable cell) to be in accordance with the 'TextHeight' of the contents of the cell in which I am editing and entering more content, the redrawing of the cell in accordance with the changed row height was not happening. Please see reference screenshot below. The 2nd line ('is my name') is what I have entered extra. The first line ('Arnold') is hiddden above it. These 2 lines are the actual contents of the cell. The 'Arnold' at the bottom you see in the sreenshot is actually not what I typed. This 'Arnold' is the original content (before I added 'is my name') appearing still at the bottom, along with a repeated ComboCue indicator (since the cell's and combocue's redrawing have not taken place, I believe).


    I looked into the control's code and saw a DrawCell method. So, I did try giving .CommitEdit and .StartEdit one after the other whenever I changed the RowHeight but I was not able to place the cursor at the correct editing point again. Please guide me as to how to achieve what I wish for. May be the way I am adopting to change the RowHeight is not the correct way to do it. Kindly help.
    ...
    Any ideas from you Krool? Or, from Georgekar, Seniorchef? Kindly guide and help, when possible.

    Kind Regards.
    Last edited by softv; Feb 7th, 2023 at 10:39 PM.

  12. #812
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I never use editing in place for VBFlexGrid. Before I will update VBFlexGrid I do a enable=false, so no redrawing happen. Then I make the update and then VBFlexGrid1.Enabled = True and VBFlexGrid1.Refresh. I always use a private variable busy as boolean, so in any event handling sub I have If busy then exit sub (so I am not disable controls like commandbutton type for a busy work).

    So your problem is that you want more things that the VBFlexGrid can do, like to auto update and redraw according the desired height. So to check it split the process, to a placeholder outside the Grid, where you edit the value to be insert, maybe two ore more lines of text, and then disable Grid, update it, enable it and refresh it.

  13. #813

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by softv View Post
    Any ideas from you Krool? Or, from Georgekar, Seniorchef? Kindly guide and help, when possible.

    Kind Regards.
    There is already an internal helper "UpdateEditRect". It currently only moves (SWP_NOSIZE used) but that could be enhanced relativ quickly to also include sizing.
    It's used for the moment only when scrolling occurs. (auto update)

    The more discussion part is whether to "auto update" on various places, e.g. RowHeight/ColWidth property (and possible more) or to just "auto update" when calling .Refresh ?

    I personally do like the "Refresh" solution better. What do you mean ? (the scrolling auto update would remain though)

    Quote Originally Posted by Seniorchef View Post
    Ok, I tested the Event - and it works for me.

    I added a RaiseEvent SortTick() and placed a DoEvents in my app in the event handler and Tataa - it's what I need.
    As I don't want to stop the sorting, it is up to you to add a Cancel to the Event. For the sake of completeness it would be better. And a timer for the SortTick would also be convenient.
    I am hesitating with this. It involves extra code in the sort routines.
    For the bubble sort (custom sort only) it's practical but for the merge sort it would involve at various places to allow good resolution.

  14. #814

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    You should now be able to call .Refresh after your .RowHeight() change and the edit window will fit to the new situation.

  15. #815
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I am hesitating with this. It involves extra code in the sort routines.
    For the bubble sort (custom sort only) it's practical but for the merge sort it would involve at various places to allow good resolution.
    Yes, i see. That's why I used the timer and the positioning in the MergeSortRec().
    As I understand this code, the MergeSortRec() is called recursively 'til the end of the splitting of the array. The static var xTimer counts on every recursion and the event should, with my sample code, be raised almost regularly. I put the code in my copy of the control and it works. Of course, the code in the MergeSortRec()-Sub to skip the checking of the event must be as short as possible.

    Here's my code
    Code:
    Private Sub MergeSortRec(ByVal Left As Long, ByVal Right As Long, ByVal Col As Long, ByRef Data() As TCOLS, ByVal Sort As FlexSortConstants)
    Dim Middle As Long
    Dim Cancel As Boolean
    Static xTimer As Single
    Middle = (Left + Right) \ 2
    
    If Left < Right Then
        Call MergeSortRec(Left, Middle, Col, Data(), Sort)
        Call MergeSortRec(Middle + 1, Right, Col, Data(), Sort)
        Call InplaceMergeSort(Left, Middle, Right, Col, Data(), Sort)
        'Every x ms a RaiseEvent() to process calling apps DoEvent
        If PropSortTickIntervall > 0 Then
          If (Timer - xTimer) * 1000 > SortTickIntervall Then
             RaiseEvent SortTick(Cancel)
             xTimer = Timer
          End If
       End If
    End If
    End Sub
    This is only an idea that works for me. I don't bother if this feature is not included in the grid as long as I can implement it by myself. It was a suggestion.

    The Custom sort has no need for this feature as there is already an event to be custom the can be used for this purpose, too.

  16. #816
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Another thing came to my attention:
    I use the event "BeforeUserResize()" to throw a Cancel when a column must not be resized.
    Works fine but that leads to a click_event on that column (and that leads to a sorting of the column in my app)
    I think the cancelled UserResize() should not lead to a click_event. Either the column is resized or not, nothing else.
    In my code, I have to set a flag to ignore the first click after a BeforeUserResize().
    Greetings

  17. #817

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Seniorchef View Post
    Another thing came to my attention:
    I use the event "BeforeUserResize()" to throw a Cancel when a column must not be resized.
    Works fine but that leads to a click_event on that column (and that leads to a sorting of the column in my app)
    I think the cancelled UserResize() should not lead to a click_event. Either the column is resized or not, nothing else.
    In my code, I have to set a flag to ignore the first click after a BeforeUserResize().
    Greetings
    I see, will check.
    But you can also use the new ColResizable() property. This goes deeper and even not shows a resize cursor.

  18. #818

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Seniorchef View Post
    Another thing came to my attention:
    I use the event "BeforeUserResize()" to throw a Cancel when a column must not be resized.
    Works fine but that leads to a click_event on that column (and that leads to a sorting of the column in my app)
    I think the cancelled UserResize() should not lead to a click_event. Either the column is resized or not, nothing else.
    In my code, I have to set a flag to ignore the first click after a BeforeUserResize().
    Greetings
    Fixed. Thanks

  19. #819
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thanks and I have a look at the ColResizeable() property.
    Back to my sample code in post #815. The cancel in the event is a leftover from my tests and has no effect in the sample. I do not need a Cancel as I don't want to interrupt the sort. Sorry for this inconvenience.
    Greetings

  20. #820

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Seniorchef View Post
    Thanks and I have a look at the ColResizeable() property.
    Back to my sample code in post #815. The cancel in the event is a leftover from my tests and has no effect in the sample. I do not need a Cancel as I don't want to interrupt the sort. Sorry for this inconvenience.
    Greetings
    Well. On a second thought one could use the CustomText sort. Which supplies only Text1/Text2 instead of Row1/Row2 but it uses the MergeSort. So there you could do the timer and DoEvents. Only draw back is you need to compare yourself.

  21. #821
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    234

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Update released.

    You should now be able to call .Refresh after your .RowHeight() change and the edit window will fit to the new situation.
    Thanks a TON, Krool. It works quite well. I did not see any issues.
    Great!

    Kind Regards.

  22. #822
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi Krool, maybe a little bug?

    If i set the grid as read only:

    Name:  cp.png
Views: 724
Size:  5.3 KB

    I can check and uncheck a cell created with .cellchecked = 0

    I will check if i'm using your last version now (i think yes)

    Edit:

    Checked, i can still check/uncheck the cell with the last version
    Last edited by Calcu; Feb 19th, 2023 at 09:52 AM.

  23. #823

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Hi Krool, maybe a little bug?

    If i set the grid as read only:

    Name:  cp.png
Views: 724
Size:  5.3 KB

    I can check and uncheck a cell created with .cellchecked = 0

    I will check if i'm using your last version now (i think yes)

    Edit:

    Checked, i can still check/uncheck the cell with the last version
    That's intended. You can check/uncheck even when AllowUserEditing is False.
    You can avoid this by .CellChecked = FlexDisabledUnchecked/Checked or by Cancel = True on the CellBeforeCheck event.

  24. #824
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Perfect, Thanks !

  25. #825

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Updated released.

    New ColCheckBoxes property to have predefined checkboxes in a column.
    All FlexNoCheckBox values are mapped as FlexUnchecked.

    This makes it easier to add new rows and automatically have new unchecked checkboxes.

    Also included GetChecked/SetChecked to the IVBFlexDataSource2 interface to enable to have virtual checkboxes.
    To avoid extra overhead here this feature is enabled only when ColCheckBoxes is set to true for the column.
    And of course FlexDataSourceChecked must be returned on IVBFlexDataSource2::GetFlags.

    ColCheckBoxes and IVBFlexDataSource2 work in conjunction but are still independent. So ColCheckBoxes can be used without IVBFlexDataSource2.

    EDIT: Added FlexNoCheckBoxEver enum to FlexCheckBoxConstants as it can be useful to exclude individual cells for ColCheckBoxes. (e.g. for frozen rows)
    Fixed rows are always excluded and must be set explicitly.
    Last edited by Krool; Feb 22nd, 2023 at 07:21 AM.

  26. #826

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    ColFormat always applied to whole column. (like vsFlexGrid)
    However, it can be safer sometimes to disable formatting on the fixed cells. So the new FixedFormat property can be used.
    But you must apply "" and not vbNullString. If the StrPtr() is 0 then FixedFormat inherits from ColFormat.

    Furthermore the internal GetLabelInfo respects now the text display. Also the AutoSize method respects the text display now.

  27. #827
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    In WIN11 operating system, it cannot be compiled into EXE, and finally it will prompt crash information such as unreadable memory

  28. #828
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    HI all,

    A little question, the checkbox color can be changed ?

    the cellforecolor is not working on a cell with a checkbox, i want a greeen checkbox when checked and a red one when it's not checked.

    It's possible?

  29. #829

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    HI all,

    A little question, the checkbox color can be changed ?

    the cellforecolor is not working on a cell with a checkbox, i want a greeen checkbox when checked and a red one when it's not checked.

    It's possible?
    I don't understand what you mean? Can you ilustrate by a picture how a checkbox with acertain forecolor would look like.

  30. #830
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Sure:

    Name:  checkbox.jpg
Views: 534
Size:  6.4 KB

    Done quick with paint xD
    In red when checkbox not checked.
    Green when checked

    The last one is untouched (i just painted the 3 first)

  31. #831

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Sure:

    Name:  checkbox.jpg
Views: 534
Size:  6.4 KB

    Done quick with paint xD
    In red when checkbox not checked.
    Green when checked

    The last one is untouched (i just painted the 3 first)
    Hmm.. could be solved by an oppurtinity to have an OwnerDraw event for the checkboxes? So you could draw them yourself how you want.

  32. #832
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    i think it could be perfect

  33. #833

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    CheckBoxDrawMode property (run-time only) included with related CheckBoxOwnerDraw event.

    The Row/Col parameter in the CheckBoxOwnerDraw event enables to draw certain columns differently for instance.

    When the Cancel As Boolean parameter is set to True the default check box drawing will be done. This enables to only owner draw certain columns effectively.

    The ItemState parameter is convenient to draw different states of the check box.
    It can be ODS_CHECKED, ODS_GRAYED, ODS_HOTLIGHT and/or ODS_DISABLED.

    The viewport is always 0, 0.

  34. #834
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi all, another question.

    Anybody else is suffering ide hangs ?

    I mean, when I change code on a form with a vbglexgrid on it, and execute it, works fine, then I change some code (not from the grid, it can be an sql for example), on the form that contains the grid, I execute my program on the IDE, and when I load the form with the grid, it hangs.

    I have to start visual basic again and then it works fine the first time, but it hangs if I start the program for a second time.

    It's just me ?

  35. #835

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Hi all, another question.

    Anybody else is suffering ide hangs ?

    I mean, when I change code on a form with a vbglexgrid on it, and execute it, works fine, then I change some code (not from the grid, it can be an sql for example), on the form that contains the grid, I execute my program on the IDE, and when I load the form with the grid, it hangs.

    I have to start visual basic again and then it works fine the first time, but it hangs if I start the program for a second time.

    It's just me ?
    The VBFlexGrid has no subclassing in IDE. Thus it shall be IDE safe.
    Can you bundle an isolated demo proofing it? Maybe some other things involved in your form causes problem.

  36. #836
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I will try to.

    what i can see is:

    this is how a normal grid is displayed on IDE:

    Name:  good grid.jpg
Views: 478
Size:  16.8 KB

    And when i change something AND save my project, then it displays this way:

    Name:  bad grid.png
Views: 474
Size:  7.0 KB

    If i start the project and go to any form with a Grid on it... IDE hangs and it closes.

    I will try to create an small project and try if it hangs too.

  37. #837
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi again,

    I was thinking.. maybe i'm doing the things wrong?

    What i'm doing is adding all the modules / controls /etc to my project (and it works)

    Maybe i should add the whole project to my project? I tried, but if i set the property public to true, i have an error when adding the control to a form about :

    Compile Error: "Private object modules cannot be used in public object modules..

    Then... what is the best way to use this project? like i'm doing or.. there is another way ?

    Edit1:

    Uh...

    I found that:

    1.- adding whole project to mine (with add project)
    2. changing the vbflexgriddemo project properties to control ActiveX
    3.- setting to true the public property of the control
    4.- setting the instance porp. to 6-globalmultiuse in both clas modules

    it seems to work fine in my project?

    It's then the best way to add this control to a project ?


    Edit2.. no it's not working something else i need to do in order to use this way

    Edit3: (sorry xD) Well finally it worked this way, adding the whole project to my project.

    I will try to use this way in order to see if not more hangs on IDE when starting / closing it.

    But, can you tell me if it's this the right way of using your control? thanks!
    Last edited by Calcu; Mar 19th, 2023 at 07:45 AM.

  38. #838

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Hi again,

    I was thinking.. maybe i'm doing the things wrong?

    What i'm doing is adding all the modules / controls /etc to my project (and it works)

    Maybe i should add the whole project to my project? I tried, but if i set the property public to true, i have an error when adding the control to a form about :

    Compile Error: "Private object modules cannot be used in public object modules..

    Then... what is the best way to use this project? like i'm doing or.. there is another way ?

    Edit1:

    Uh...

    I found that:

    1.- adding whole project to mine (with add project)
    2. changing the vbflexgriddemo project properties to control ActiveX
    3.- setting to true the public property of the control
    4.- setting the instance porp. to 6-globalmultiuse in both clas modules

    it seems to work fine in my project?

    It's then the best way to add this control to a project ?


    Edit2.. no it's not working something else i need to do in order to use this way

    Edit3: (sorry xD) Well finally it worked this way, adding the whole project to my project.

    I will try to use this way in order to see if not more hangs on IDE when starting / closing it.

    But, can you tell me if it's this the right way of using your control? thanks!
    There is a separate Ax version (OCX). See link in 1. post on this thread.

  39. #839
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I know, but when I need to update it, it's better using it embedded in my soft.

    It seems, that is working fine when I created the group of programs in vb6

    Edit:

    I did more tests (i inform just to see if maybe you/somebody has an idea).

    Created New Project.
    Added everything again (forms, modules, controls, everything from the old one).
    Everything works fine, no hangs in IDE.

    Then if i write anything in a form with no grid, and save, everything stills fine.
    BUT if i modify a form that has a grid, and SAVE the project, when i load the project again and enter in a form that has a grid, it hangs.

    In the windows events it created an error event:

    Code:
    Nombre de la aplicación con errores: VB6.EXE, versión: 6.0.97.82, marca de tiempo: 0x403acf6c
    Nombre del módulo con errores: unknown, versión: 0.0.0.0, marca de tiempo: 0x00000000
    Código de excepción: 0xc000041d
    Desplazamiento de errores: 0x0968813f
    Identificador del proceso con errores: 0x30cc
    Hora de inicio de la aplicación con errores: 0x01d95b25eb387a57
    Ruta de acceso de la aplicación con errores: C:\VB98\VB6.EXE
    Ruta de acceso del módulo con errores: unknown
    Nombre completo del paquete con errores: 
    Identificador de aplicación relativa del paquete con errores:
    Last edited by Calcu; Mar 20th, 2023 at 08:43 AM.

  40. #840
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi again, sorry for the monologue.

    Found when it hangs:



    If i stop the program at this line, and then i press F8, it hangs.

    I will try to find if i have any api in conflict with it, but any ideas will be welcome.

    Thanks in advance
    Attached Images Attached Images   
    Last edited by Calcu; Mar 21st, 2023 at 04:08 AM.

Page 21 of 34 FirstFirst ... 111819202122232431 ... 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