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...
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.
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.
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.
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
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.
Originally Posted by fabel358
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.
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.
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).
Last edited by Eduardo-; Jul 6th, 2025 at 06:50 AM.
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.
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?
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.
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.
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.
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?
Originally Posted by fabel358
I also verified what you wrote: I introduced the FlexGrid in a PictureBox and now the custom ToolTipText actually works. Congratulations!
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.
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
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.
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.
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.
Originally Posted by fabel358
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).
Originally Posted by fabel358
Thanks for your patience and do not feel offended if I do not follow your suggestions.