Page 9 of 9 FirstFirst ... 6789
Results 321 to 340 of 340

Thread: NewTab: tab control for VB6

  1. #321

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Quote Originally Posted by fabel358 View Post
    I tried some settings and I can't restore the initial conditions . Is there a possibility of a reset?
    I don't know what you mean by "settings", "initial conditions" and "reset".
    Unless you are very, very specific about what you did, what you expected and what you got...

  2. #322

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    For initial conditions delete the control and add a new one.
    Or close the project without saving and open it again.

  3. #323

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Sometimes with controls that have many properties, and properties that we don't know what they do, we can get to a situation that we want to go back but don't know how.
    Unfortunately VB6 does not provide a way to undo changes in properties.
    Controls could keep track of the changes and offer a way to go back or to go forward, like a "history".
    I never saw a control like that, but is possible.

    The only thing I do when I get to that "state", is to close the project without saving. In case that you didn't do other important changes that need to be preserved... That's why I save the project frequently while it is in a good state.

  4. #324
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    I'll start by saying that "NewTab01.ocx" is a great job, however I found what I think is a "bug".
    If I place a flexgrid with MsFlexGrid on NewTab, populate it with data and with the Flex_MouseMove subroutine, set a different tooltiptext for each cell and a Toolitip in the NewTab, it happens that in the IDE everything works as expected. If I compile the code, moving the mouse over the flexgrid, instead of the flexgrid tooltiptext appearing, the newtab tooltiptext continues to appear.
    I add the code; to make it work open a new form, place NewTab1 on it and inside this MsFlexGrid with the name Flex and verify.
    In a Form:
    Code:
    Option Explicit
    
    
    Private Sub Flex_MouseMove(Button As Integer, Shift As Integer, x As Single, y _
        As Single)
       Dim lRow             As Integer
       Dim lCol             As Integer
       Dim Tip              As String
       With Flex
          lRow = .MouseRow
          lCol = .MouseCol
          Tip = .TextMatrix(lRow, lCol)
          If LenB(Tip) Then
             .ToolTipText = Tip
          End If
       End With
    
    End Sub
    
    Private Sub Form_Load()
       Dim x                As Integer
       Dim y                As Integer
    
       With Flex
          For y = 1 To .Cols - 1
             For x = 1 To .Rows - 1
                .TextMatrix(x, y) = CStr(x) & " - " & CStr(y)
             Next x
          Next y
       End With
    
       NewTab1.ToolTipText = "This is NewTAB01"
    End Sub
    Last edited by fabel358; Jul 3rd, 2025 at 07:29 AM.

  5. #325

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    It seems there is a bug in the MSFlexGrid. It also happens with a bare UserControl. But with the UserControl of the same project it also happens in the IDE.
    On other hand, a PictureBox works fine.

    Attached is the test project.

    Anyway, why do you want to put a ToolTipText for the whole NewTab control? Perhaps you rather woud like to put tooltip text to the individual tabs. For that use the TabToolTipText property.
    Attached Files Attached Files

  6. #326
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    Quote Originally Posted by Eduardo- View Post
    It seems there is a bug in the MSFlexGrid. It also happens with a bare UserControl. But with the UserControl of the same project it also happens in the IDE.
    On other hand, a PictureBox works fine.

    Attached is the test project.

    Anyway, why do you want to put a ToolTipText for the whole NewTab control? Perhaps you rather woud like to put tooltip text to the individual tabs. For that use the TabToolTipText property.
    However, with TabCtl32.ocx, this problem does not happen, regardless of whether tooltiptext or TabToolTipText is used in NewTab01.ocx

  7. #327

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Quote Originally Posted by fabel358 View Post
    However, with TabCtl32.ocx, this problem does not happen, regardless of whether tooltiptext or TabToolTipText is used in NewTab01.ocx
    Yes, it seems to be a problem of VB6's UserControl (in what is based the NewTab) with MSFlexGrid or maybe with any third party control (that would require to check and see).

    Anyway, I don't see any usefulness in setting the ToolTipText property in the NewTab control. That property is automatically added by VB, I didn't add the feature myself. I think it makes no sense for this kind of control.

    What I did add, is the TabToolTipText property.

    Quote Originally Posted by fabel358 View Post
    However, with TabCtl32.ocx, this problem does not happen, regardless of whether tooltiptext or TabToolTipText
    The SSTab did not have the TabToolTipText property.

    In summary: I don't think there is much I can do since it is a VB6 bug. On the other hand, I don't think it is a real issue, because I don't see a real life case when setting the ToolTipText on a NewTab control would make much sense.

    What were you trying to do?

  8. #328
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    We don't quite understand each other. What I was interested in was not so much having the ToolTipText property for the "TAB"; I was interested in being able to have ToolTipText working in the flexgrid (as I showed in the example); adding msFlexGrid to NewTab - whether or not it has "ToolTipText" set, does not make the ToolTipText of the msFlexGrid appear - or rather: it works in the IDE but not in the compiled program. I repeat that the problem, with TabCtl32.ocx (which is less performant and less beautiful than NewTab01.ocx) does not happen; to verify what I write it is sufficient to change NewTab01.ocx with TabCtl32.ocx and exactly what I am describing happens. So I do not believe it is a bug of VB6.

  9. #329

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Quote Originally Posted by fabel358 View Post
    So I do not believe it is a bug of VB6.
    Fortunately, these kind of things are much easier than believing or not believing. We can test them:
    Attached Files Attached Files

  10. #330

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    And when I say VB6, it is because NewTab is made in Vb6. Yes, it is a bug in NewTab, but one I'm not able to fix because it is a VB6 bug.

    I don't have any control regarding how Vb6 handles the tool tips.

    So, the only solution I see is to use another tool tip system.

  11. #331

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Well, there is another solution. Use the VBFlexGrid. I just tested and the problem seems to be with MSFleGrid, MSHFlexGrid, and maybe all third party non-VB6 generated OCX, or at least MS-ones, but not with third party controls created with VB6.
    It does not happen with intrinsic controls either (such as TextBox, PictureBox, etc.)

    The VBFlexGrid is a MSFlexGrid replacement created by Krool and with many advantages (for example supporting Unicode and many other improvements).

  12. #332
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    Now I understand what you meant when you explained that it is a bug of VB6. I can't use VBFlexGrid because I had to implement functions in msFlexGrid, which Krool's VBFlexgrid doesn't have (I had already asked Krool about this months ago); I mean I don't want to get bogged down in re-adapting and rewriting a lot of the code. So I'm staying with TabCtl32.ocx, even if your control is much better.
    Many thanks.

  13. #333

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Quote Originally Posted by fabel358 View Post
    Now I understand what you meant when you explained that it is a bug of VB6. I can't use VBFlexGrid because I had to implement functions in msFlexGrid, which Krool's VBFlexgrid doesn't have (I had already asked Krool about this months ago); I mean I don't want to get bogged down in re-adapting and rewriting a lot of the code. So I'm staying with TabCtl32.ocx, even if your control is much better.
    Many thanks.
    I tested a workaround and it worked: just place the MSFlexGrid inside a PictureBox:

    PS: I'm curious, what is the feature that the VBFlexGrid lacks and MSFlexGrid has?
    Attached Files Attached Files

  14. #334
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    Neither Grid has the function I wanted, so I created it for MsFlexGrid because I didn't want to get bogged down in adapting the code for VBFlexGrid. I needed a function that would allow me to have text in different styles and even different colors within the same cell. I achieved this through the use of pictureboxes with relative manipulation of row heights.Attachment 195109

    Here's the effect I wanted; I've removed some of the names for privacy but there's enough visibility to see what I mean.
    Name:  Immagine2.jpg
Views: 183
Size:  8.3 KB
    P.S. If you don't see it, I'll provide the Google Drive links
    Last edited by fabel358; Jul 6th, 2025 at 12:43 PM.

  15. #335
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    I also verified what you wrote: I introduced the FlexGrid in a PictureBox and now the custom ToolTipText actually works. Congratulations!

  16. #336

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Quote Originally Posted by fabel358 View Post
    Neither Grid has the function I wanted, so I created it for MsFlexGrid because I didn't want to get bogged down in adapting the code for VBFlexGrid. I needed a function that would allow me to have text in different styles and even different colors within the same cell. I achieved this through the use of pictureboxes with relative manipulation of row heights.Attachment 195109

    Here's the effect I wanted; I've removed some of the names for privacy but there's enough visibility to see what I mean.
    Name:  Immagine2.jpg
Views: 183
Size:  8.3 KB
    P.S. If you don't see it, I'll provide the Google Drive links
    Ah, OK, then the MSFlexGrid didn't support what you wanted either. But I mean, why the same code (the same workaround) that you used with MSFlexgrid could not be used with VBFlexGrid?

    Quote Originally Posted by fabel358 View Post
    I also verified what you wrote: I introduced the FlexGrid in a PictureBox and now the custom ToolTipText actually works. Congratulations!

  17. #337
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    I already gave the answer.
    My project is finished. It has 21 tabs, with 5 flexgrids per tab, plus more in other forms; just replacing TabCtl32.ocx with your NewTab01.ocx, despite the ease of replacing one ocx with the other, gave me the nasty surprise of the impossibility of custom tooltiptexts in the grid (at least there was a FAQ that would have warned me of the problem - but I think you didn't even know about this defect); not to mention the different sizes of the various themes, hence the use of the most generic theme (i.e. sstab).
    Imagine replacing more than 100 flexgrids on an already finished project: any difference in the management of anything, would cost me hours and hours to re-adapt all the code.
    No thanks!
    Last edited by fabel358; Jul 6th, 2025 at 05:05 PM.

  18. #338

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    I'm not saying that you should do it, but just for the record, you could replace the MSFlexGrid with The VBFlexGrid quite easily.

    1) Make a backup copy of the whole project (just in case that things go wrong, to be able to go back).
    2) Get some tool to make text replacements on multiple files. I use TexRep.
    3) Register VBFlexGrid v18.
    4) Replace in the vbp file
    Code:
    Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX
    with
    Code:
    Object={075212A8-C1CF-444E-939D-F6046CCDBC08}#1.0#0; VBFLXGRD18.ocx
    5) Replace in the frm files
    Code:
    Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
    with
    Code:
    Object = "{075212A8-C1CF-444E-939D-F6046CCDBC08}#1.0#0"; "VBFLXGRD18.ocx"
    and
    Code:
    MSFlexGridLib.MSFlexGrid
    with
    Code:
    VBFLXGRD18.VBFlexGrid
    And... if everything goes right, the project should open now using all VBFlexGrids instead of MSFlexGrids.
    And if not... delete and put the backup back.

    5 minutes.
    OK, 10 minutes for being the first time.

  19. #339
    Addicted Member
    Join Date
    Nov 2016
    Location
    Italy
    Posts
    223

    Re: NewTab: tab control for VB6

    We don't understand each other.
    My project has many "forms" and more than 31 thousand lines of code; "texrep" does not allow to select specific extensions, such as .vbp or .frm; even replacing the files with *.*, in several files the MsFlexGrid control remained, despite "TexRep" having indicated the replacement.
    I would have liked to trust your advice, but your suggestion is valid for maybe a few hundred lines of code and half a dozen controls.
    Or I should have started my application already with the NewTab01.ocx and VBFLXGRD18.ocx controls perfectly working and not "work in progress", building all the architecture around them.
    Thanks for your patience and do not feel offended if I do not follow your suggestions.

  20. #340

    Thread Starter
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,509

    Re: NewTab: tab control for VB6

    Quote Originally Posted by fabel358 View Post
    We don't understand each other.
    My project has many "forms" and more than 31 thousand lines of code; "texrep" does not allow to select specific extensions, such as .vbp or .frm;
    Yes, it does.

    Quote Originally Posted by fabel358 View Post
    even replacing the files with *.*, in several files the MsFlexGrid control remained, despite "TexRep" having indicated the replacement.
    I would have liked to trust your advice, but your suggestion is valid for maybe a few hundred lines of code and half a dozen controls.
    You can replace any number of controls in any number of forms at once (in less than 1 second).

    Quote Originally Posted by fabel358 View Post
    Thanks for your patience and do not feel offended if I do not follow your suggestions.
    No, of course. As I said "just for the record".

Page 9 of 9 FirstFirst ... 6789

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