Page 22 of 34 FirstFirst ... 121920212223242532 ... LastLast
Results 841 to 880 of 1321

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #841
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    1,320

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    It's kinda hard to read the text in your screenshot but as far as I can distinguish you are calling "CreateWindowEx" and the last parameter is "ObjPtr(Me)" for some reason. MSDN says that parameter must be a pointer to window-creation data. Pretty sure you should put zero in there and it will work correctly.

  2. #842
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi, thanks, if you click under "Found when it hangs:" i think the image will be open in another tab and bigger.

    This code is nost mine, is in krool's project, I will try to use a zero on it, but if it's a bug, maybe krool can tell us more.

    I will try it asap.

    Thanks again !

  3. #843
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Tried.

    Using Zero it hangs directly. :-(

  4. #844

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Maybe it fails on CreateWindowsEx because VBFlexGridWndClass failed to register previously?

  5. #845
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    But it's too strange.... it works fine when i load the project the first time, then if i edit a form that has on it a grid, save it, and then if i start he project, when i open a form with a grid... hangs.

    It's like when exiting the fist time, it's not releasing something (i can check if a have some previous version of the grid, i think this didn't happen, i will take a look and try it.).

    the form i'm editing has 2 Grids on it, but it happens the same (i think) with a form with only 1 grid

  6. #846
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Exactly!

    The problem is this code:

    Code:
    Public Sub FlexWndRegisterClass()
    If (FlexClassAtom Or FlexRefCount) = 0 Then
        Dim WCEX As WNDCLASSEX, ClassName As String
        ClassName = "VBFlexGridWndClass"
        With WCEX
        .cbSize = LenB(WCEX)   '48
        ' CS_VREDRAW and CS_HREDRAW will not be specified as entire redraw upon resize is not necessary.
        .dwStyle = CS_DBLCLKS   '8
        .lpfnWndProc = ProcPtr(AddressOf FlexWindowProc)   '38412116   ---- 38439988
        .cbWndExtra = 4
        .hInstance = App.hInstance                         '4194304 ------- 4194304
        .hCursor = LoadCursor(0, IDC_ARROW)                '65541 --------- 65541
        .hbrBackground = 0
        .lpszClassName = StrPtr(ClassName)                 '148822172  ---- 148357940
        End With
        FlexClassAtom = RegisterClassEx(WCEX)              '-15529  ---  0  <---- i think this is the problem
        If FlexSplitterBrush = 0 Then

    I wrote the values of the first run (when everything works) in red.

    And on it's right side, the ones from a second run (when it will hang)

    It's not working the registerclassEx(wcex)

  7. #847
    Frenzied Member VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    1,320

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    MSDN says that: "All window classes that an application registers are unregistered when it terminates.". So this works correctly in a compiled EXE but in IDE you need to use "UnregisterClass" on "Form_Unload" if you want to start the app again without closing the IDE.

  8. #848

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    The problem might be that UserControl_Terminate won't fire in the first run ? Can you confirm?

  9. #849
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    It fires fine.

    Maybe the problem is when i have 2 grids in the same form ? that it only fires one time ?

    Let me check it

  10. #850
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    CONFIRMED!

    If i modify a form that has 2 grids (when i say modify, i mean add any line of code, a comment is valid too), and save the project, then i start the project and load any form with a grid, it hangs.

    Loading any form with a grid, not necessarily the one i modified, the project hangs.

    It seems only unloads one grid, not the second one.

    I think that, because if i modify a form with ONLY 1 grid on it, everything runs fine, no hangs at all.
    Last edited by Calcu; Mar 22nd, 2023 at 12:43 PM.

  11. #851
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Tried to fix It by myself, but... Lack of knowledge... :-(

  12. #852

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Tried to fix It by myself, but... Lack of knowledge... :-(
    Can you share a demo project isolating the problem?

  13. #853
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I was creating a simple project (added) :

    3 forms + your project , everything was fine... (strange)

    And i just added 1 control (a control to show tabs on a MDI form), and it broken everything...

    Added the project with the control... the tlb used with the control is who messed everything...

    Let's see if you can identify the problem (looking to when the problem appeared.... i don't think it's on your code, but...)

    Open my project
    check the references, because i have the tlb on my system directory (added all the necessary at the zip file)
    open 1 form
    write anything on the code
    save
    you will see the grids grayed.
    it will hang on open


    proyecto_prueba.zip

  14. #854
    Member
    Join Date
    Mar 2020
    Location
    Germany (BW)
    Posts
    42

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    In your project are some files missing to reproduce the error.
    There are some classes that you need to make the RevMDITabs usercontrol run as a part of your project.
    You could avoid this problem (and you did it halfway) by including the ocx to the components of your project INSTEAD of implementing the source for the control.
    But if you do so you must include ALL parts of the OCX-source into you project (there is a BAS and three CLS not in your project).
    So do as I did:
    - remove the usercontrol from your MDIForm
    - remove the component from the project
    - add all parts of the usercontrol OCX to your project
    - add the usercontrol from your project to your MDIform
    Save the project and - enjoy
    Greetings
    I you do so (and I did), then there is no problem to edit you project or run it and fill the grids.
    Greetings

  15. #855
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I think i added all of them inside the project zip, just add them again when open the vbp, because i have them registered in another paths in my computer

    Maybe i'm wrong ?

    Edit 1:

    you are right, i found the missing class (that's the problem when you create a project too fast..., sorry) 1 sec.

    Edit2:

    Checked twice, now it's complete.

    proyecto_prueba3.zip

    can you test it ? you will know if it will hang, because the grid will be grayed when you push the save project button.

    But.. there has to be something else, i have 2 diferents project without this control, and they are having the same problem.

    Edit 3:

    try this steps, i finally made it hung:

    1.-open the project
    2.- close all forms
    3.- open form1
    4.- click on save
    5.- edit form_load (from form1), insert some comment : 'aaaaaa
    6.- change to form view
    7.- save again
    8.- go to project - components - add microsoft windows common controls-2 6.0
    9.- apply

    you will see the grids grayed.
    i think i can make a video
    Last edited by Calcu; Mar 26th, 2023 at 05:59 AM.

  16. #856
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    uploaded a video showing what it does.

    If a run the project when the grid grayed out, it force closes the IDE

    unzip the file and look at the video
    Attached Files Attached Files

  17. #857
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi all,

    I think I found another bug.

    I have a little sub to display a background color:

    Code:
    Public Sub Degradado(ElObjecto As Object)
    
    Dim i As Single
    Dim Y As Single
    
        ElObjecto.DrawStyle = 6     '0
        ElObjecto.DrawMode = 13     '13
        ElObjecto.DrawWidth = 2     '1
        ElObjecto.ScaleMode = 3    ' 1
        ElObjecto.ScaleHeight = (256 * 2)    '12150
        
        For i = 255 To 0 Step -1
             ElObjecto.Line (0, Y)-(ElObjecto.Width, Y + 2), RGB(i, i, i), BF
             Y = Y + 2
        Next i
    
    End Sub

    If i call it in the form_Resize event, the .hitrow of the grid is always returning -1. ¿?

    If i comment scalemode and scaleheight from this sub, then the grid works as usual.

    Ok, just using Scalemode = 3 in the form prop. it just doesn't work the .hitrow value
    Last edited by Calcu; Mar 27th, 2023 at 03:00 AM.

  18. #858

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    Hi all,

    I think I found another bug.

    I have a little sub to display a background color:

    Code:
    Public Sub Degradado(ElObjecto As Object)
    
    Dim i As Single
    Dim Y As Single
    
        ElObjecto.DrawStyle = 6     '0
        ElObjecto.DrawMode = 13     '13
        ElObjecto.DrawWidth = 2     '1
        ElObjecto.ScaleMode = 3    ' 1
        ElObjecto.ScaleHeight = (256 * 2)    '12150
        
        For i = 255 To 0 Step -1
             ElObjecto.Line (0, Y)-(ElObjecto.Width, Y + 2), RGB(i, i, i), BF
             Y = Y + 2
        Next i
    
    End Sub

    If i call it in the form_Resize event, the .hitrow of the grid is always returning -1. ¿?

    If i comment scalemode and scaleheight from this sub, then the grid works as usual.

    Ok, just using Scalemode = 3 in the form prop. it just doesn't work the .hitrow value
    .HitRow just works if you do a .HitTest before. If you want a direct result of the current cursor position you can use .MouseRow.

  19. #859
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I tested it yesterday, it wasn't working

    With Form in Twips:

    Attachment 187263

    It shows the row i clicked

    Attachment 187262


    If i change the form to Pixel:
    Attachment 187264

    The same code throw:

    Attachment 187265

  20. #860

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Calcu View Post
    I tested it yesterday, it wasn't working

    With Form in Twips:

    Attachment 187263

    It shows the row i clicked

    Attachment 187262


    If i change the form to Pixel:
    Attachment 187264

    The same code throw:

    Attachment 187265
    The flex grid wants always twips. (Like MSFlexGrid)
    You can have a Form as pixels, you just need to use Form.ScaleXY to convert to twips.
    So its not a bug but a feature.

  21. #861
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Thanks!, understood.

    Edit:


    Have you been able to reproduce the other error?
    Last edited by Calcu; Mar 28th, 2023 at 10:35 AM.

  22. #862

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Update released.

    The new read-only properties ComboButtonWidth/ComboButtonClientWidth are helpful to use with button pictures.

    If a button picture is too large it will be truncated. The height of the combo button is determined by the row height, but the width was fixed.

    For drop-down button the width will continue to be fixed. So the new ColComboButtonWidth(i) property only is applicable for combo mode 3 - Button. (where only there a picture can be placed)

    Below is a code example to make best-fit width of a certain picture.

    Code:
    Dim NonClientWidth As Long, Picture As IPictureDisp
    NonClientWidth = VBFlexGrid1.ComboButtonWidth - VBFlexGrid1.ComboButtonClientWidth
    Set Picture = Picture1.Picture
    Set VBFlexGrid1.ColComboButtonPicture(1) = Picture
    VBFlexGrid1.ColComboButtonWidth(1) = NonClientWidth + Me.ScaleX(CHimetricToPixel_X(Picture.Width), vbPixels, vbTwips)

  23. #863
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi all, can anybody tell me what event must i use to detect that some text is pasted from the clipboard?

    I'm pasting fine (control + v), but i can't detect a change or i don't know how to do it, i want to check what the user pasted and i can't detect when it was done...

    Ideas?

    Thanks!


    Edit:

    Solved this way, but i have to test it more:

    In the Keydown event of the grid:

    Code:
    Private Sub Gr1_KeyDown(KeyCode As Integer, Shift As Integer)
        
        ' copiar: CTRL-C, CTRL-X, CTRL-INS
        If KeyCode = vbKeyC And Shift = 2 Then Copiando = True
        If KeyCode = vbKeyX And Shift = 2 Then Copiando = True
        If KeyCode = vbKeyInsert And Shift = 2 Then Copiando = True
    
        ' pegar: CTRL-V, SHIFT-INS
        If KeyCode = vbKeyV And Shift = 2 Then Pegando = True
        If KeyCode = vbKeyInsert And Shift = 1 Then Pegando = True
        
    
    End Sub


    And then in the SelChangeEvent:

    Code:
    Private Sub Gr1_SelChange()
    If Pegando Then
         Gr1.AutoSize 0, 14, FlexAutoSizeModeColWidth, FlexAutoSizeScopeAll, False, 50
       
          'more things to check
    
        Pegando = False
    End If
    
    End Sub
    Last edited by Calcu; Apr 13th, 2023 at 02:36 AM.

  24. #864
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi Krool,

    I'm trying to highlight a compete row when I select it. I can't seem to get column 0 to turn background blue like the rest of the columns in the row. What am I missing?

    Is there a way to unselect the row with a mouse click?

    I'm having great results using VB6 to create OCX forms and class libraries ScriptBasic can recieve event callbacks from and access the form OCX classes using it 'CallByName' COM extension module.
    Last edited by ScriptBASIC; Apr 24th, 2023 at 02:12 AM.

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

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by ScriptBASIC View Post
    I'm having great results using VB6 to create OCX forms and class libraries ScriptBasic can recieve event callbacks from and access the form OCX classes using it 'CallByName' COM extension module.
    sounds interesting.
    Could you share your script language.

  26. #866
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    ScriptBasic is an open source (MIT Common licensed) written in ANSI C. I have been maintaining the embeddable scripting engine since 2005. ScriptBasic runs on everything with unlimited expansion with it's C extension module API.

    You can download ScriptBasic for Windows 32 bit install from HERE.

    This is a screen shot of a current support time entry project I'm working on for a client. It uses ScriptBasic for base language and a VB6 OCX form / class COM DLL for the UI. I used ODBC to access both MS SQL and Sage 100 accounting software. I'm also using Sage 100's customer lookup via a BOI (Business Object Interface) without showing the Customer maintenance form which is done in ProvideX Business Basic.

    Last edited by ScriptBASIC; Apr 24th, 2023 at 03:05 PM.

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

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by ScriptBASIC View Post
    ScriptBasic is an open source (MIT Common licensed) written in ANSI C. I have been maintaining the embeddable scripting engine since 2005. ScriptBasic runs on everything with unlimited expansion with it's C extension module API.

    You can download ScriptBasic for Windows 32 bit install from HERE.
    interesting i will take a look

  28. #868

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by ScriptBASIC View Post
    Hi Krool,

    I'm trying to highlight a compete row when I select it. I can't seem to get column 0 to turn background blue like the rest of the columns in the row. What am I missing?

    Is there a way to unselect the row with a mouse click?

    I'm having great results using VB6 to create OCX forms and class libraries ScriptBasic can recieve event callbacks from and access the form OCX classes using it 'CallByName' COM extension module.
    Make .FocusRect = FlexFocusRectNone and .SelectionMode to either ByRow or FreeByRow.

    If you then make .AllowMultiSelection = True you can unhighlight by ctrl+click.

  29. #869
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Krool,

    Thanks for the reply. That didn't seem to work. I tried to disable multi-line select but that didn't work either.

    Code:
      TableGrid.FocusRect = FlexFocusRectNone
      TableGrid.SelectionMode = FlexSelectionModeByRow
      TableGrid.AllowMultiSelection = False
    Name:  select_issue.jpg
Views: 525
Size:  10.9 KB

  30. #870

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by ScriptBASIC View Post
    Krool,

    Thanks for the reply. That didn't seem to work. I tried to disable multi-line select but that didn't work either.

    Code:
      TableGrid.FocusRect = FlexFocusRectNone
      TableGrid.SelectionMode = FlexSelectionModeByRow
      TableGrid.AllowMultiSelection = False
    Name:  select_issue.jpg
Views: 525
Size:  10.9 KB
    Can you provide a demo? For me it worked..

  31. #871
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I'll create a simple .exe form with just VBFLXGRD and zip up the source. Thanks for your help!

  32. #872
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Krool,

    Here is my property list for the grid control. Maybe something I've set is conflicting with your recommended settings.


  33. #873
    Lively Member ScriptBASIC's Avatar
    Join Date
    Oct 2014
    Location
    Anacortes, WA
    Posts
    75

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Krool,

    All of a sudden it started working correctly while working on a non-grid portion of the code. I think your code additions finally woke up.



    Thanks for the help getting this working!

  34. #874

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    OCX version 1.6 released.

  35. #875
    Lively Member
    Join Date
    May 2022
    Posts
    84

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Hi all!

    I'm enjoying a lot this grid, thanks again Krool.

    Just a question, when copying the data from the grid, and pasting it in a email, is there any option to paste the lines of the selected cells too ?

  36. #876
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Question Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Update released.

    AllowUserFreezing property now included.

    Also the new AfterUserFreeze event fires after a user changed the number of frozen rows or columns.
    Hi, Krool!

    Can you tell us how can a user change the number of frozen rows or columns? I know how to do it by code (FrozenRows property), but it will not fire the AfterUserFreeze event. How does it work?

  37. #877

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Nouyana View Post
    Hi, Krool!

    Can you tell us how can a user change the number of frozen rows or columns? I know how to do it by code (FrozenRows property), but it will not fire the AfterUserFreeze event. How does it work?
    Ensure that you have the AllowUserFreezing property set to True.
    Below gif says more than words.

    Name:  FlexAllowUserFreezing.gif
Views: 311
Size:  105.8 KB

  38. #878
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    Below gif says more than words.
    Thank you very much!

  39. #879
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Lightbulb Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    For me it worked..
    It works fine, but, in my opinion, the rectangle should not disappear when focus is changed to another control (unlike the MSFlexGrid).

  40. #880
    Hyperactive Member
    Join Date
    May 2018
    Location
    Russia
    Posts
    316

    Exclamation Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    I don't know what does it mean, but when I start the DEMO project (the last version) I give this error. The project is loaded and works fine.

    WinXp SP3
    Attached Images Attached Images  

Page 22 of 34 FirstFirst ... 121920212223242532 ... 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