-
Re: CommonControls (Replacement of the MS common controls)
MountainMan,
True. The property pages are only needed for IDE or OCX.
For the compiled Std-EXE it is not needed.
Even the API 'OleCreatePropertyFrame' to show the property pages at run-time do work only in IDE or when compiled only when linked to a OCX.
-
Re: CommonControls (Replacement of the MS common controls)
An extraordinary volume of work. Keep it up! Sad I was unable to make use of it in a VB6 reboot. I had the finance, the planning, the background, the external support, and I made the big mistake of coming here and asking for input, help and encouragement. Sadly MS has broken your colleagues here and rampant negativity, even mockery, was all I got. I now know how Elon Musk felt when he offered the Thai cave boys a submarine only to be rounded on. Maybe someone will come and make use of your fantastic work as you deserve recognition.
-
Re: CommonControls (Replacement of the MS common controls)
Hi LOfADay. Just about everyone on this forum is contributing to not only keeping VB6 alive but improving on it. Krool's work is evidence of that but he is by no means the only one. I am not sure what your beef is about but if you want to be part of our small community please join us in a positive way. We'd love to have you and your ideas. I looked at your previous posts on this forum and couldn't see anything particularly bad but obviously something ticked you off. Every online community has some irritating people but this forum seems to have a lot less of that than almost any online community I have seen or been part of. If you want to be positive please jump in. if you don't please take the negativity somewhere else.
-
Re: CommonControls (Replacement of the MS common controls)
First of all thanks for all your wooooork.
in .Net it is possible to add to the toolbar (in addition to the Button) other controls like Textbox, Combo Etc.... I have even managed to put DateTime and many other Controls.
Would this be possible to add this on your toolbar, this would save lots of coding of positioning controls on form load.
thanks
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Semke
First of all thanks for all your wooooork.
in .Net it is possible to add to the toolbar (in addition to the Button) other controls like Textbox, Combo Etc.... I have even managed to put DateTime and many other Controls.
Would this be possible to add this on your toolbar, this would save lots of coding of positioning controls on form load.
thanks
You can use the CoolBar in combination with the ToolBar. The CoolBar can manage child controls.
-
Re: CommonControls (Replacement of the MS common controls)
Krool,
One more question. In the standard module ComCtlsBase you have a conditional compilation constant ImplementIDEStopProtection and it appears to toggle whether or not you include code for the StdEXE controls to be safely used in the IDE. If I have a project with the OCX version of your controls and I modify it to now use the StdEXE ones and then I compile that with the commandline compilation capability of VB6.exe, I believe I can set this conditional compilation constant = FALSE because the resultant executable is not going to be in the IDE. Is this correct?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
wqweto
A
Repaint routine can be implemented as a stronger alternative to
Refresh like this
thinBasic Code:
Private Sub pvPumpMessages(ByVal hWnd As Long, ByVal lFromMsg As Long, ByVal lToMsg As Long)
Dim uMsg As APIMSG
Do While PeekMessage(uMsg, hWnd, lFromMsg, lToMsg, PM_REMOVE) <> 0
Call DispatchMessage(uMsg)
Loop
End Sub
Public Sub Repaint()
pvPumpMessages ContainerHwnd, WM_PAINT, WM_PAINT
End Sub
. . . or Karl77 can call
pvPumpMessages in client code after batch updating the other 100s of labels on the form in question :-))
cheers,
</wqw>
Just FYI, I have to admit that recently I found out that there is a win32 API function specifically for sending WM_PAINT messages (only if required/if anything is invalidated) to a hwnd and it's as simple as UpdateWindow.
Using pvPumpMessages in Repaint above is an example of over-complication par excellance instead of a simple Call UpdateWindow(ContainerHwnd) API call.
Sorry once again about that. . .
cheers,
</wqw>
-
Re: CommonControls (Replacement of the MS common controls)
Hi!
Is there any way to print on toobar button placeholder, I use that to put controls and I would like to print a description of the control above it.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
COMMON DIALOG QUESTION
Using the VBCCR CommonDialog class, how can I add a button to the file dialog?
Like this:
Attachment 163293
And let some code work from this button?
The goal is to set a predifined folder to browse.
Thank you
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
MountainMan
Krool,
One more question. In the standard module ComCtlsBase you have a conditional compilation constant ImplementIDEStopProtection and it appears to toggle whether or not you include code for the StdEXE controls to be safely used in the IDE. If I have a project with the OCX version of your controls and I modify it to now use the StdEXE ones and then I compile that with the commandline compilation capability of VB6.exe, I believe I can set this conditional compilation constant = FALSE because the resultant executable is not going to be in the IDE. Is this correct?
Correct
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
COMMON DIALOG QUESTION
Using the VBCCR CommonDialog class, how can I add a button to the file dialog?
I now see this is easily possible with this:
http://www.vbforums.com/showthread.p...t-Another-One)
It seems I can easily use this one instead of the VBCCR solution.
Means: Solved.
-
Re: CommonControls (Replacement of the MS common controls)
On the LinkLabel control, is it possible to expose the Link forecolor property to the developer? It's currently outside of the developer's ability to control (there's no property for this on the control). I imagine that it's reading some system value for this. In my app I use a slightly different shade of blue for links and I'd like to set the LinkLabel.LinkForeColor to this same app-wide link color.
Thanks for the consideration.
-
Re: CommonControls (Replacement of the MS common controls)
Also, I'd like to use the LinkLabel control as a replacement for the current Label control when the caption requires an embedded hyperlink. Therefore, it should have much of the same functionality as the Label control where possible to allow for easiest drop in replacement. For example, the Alignment options for LinkLabel should be vbLeftJustify, vbCenterJustify, and vbRightJustify just the Label control. But currently only Left and Right are offered. Is there a reason for this?
Other "missing" LinkLabel properties which would be useful are:
Appearance
AutoSize
EllipsisFormat
VerticalAlignment
WordWrap
Of all of these discussed, the two which are preventing me from using this control in my project are the LinkForeColor and Alignment = vbCenter
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
AAraya
On the LinkLabel control, is it possible to expose the Link forecolor property to the developer? It's currently outside of the developer's ability to control (there's no property for this on the control). I imagine that it's reading some system value for this. In my app I use a slightly different shade of blue for links and I'd like to set the LinkLabel.LinkForeColor to this same app-wide link color.
There is a Event for it:
Code:
LinkForeColor(ByVal Link As LlbLink, ByRef RGBColor As Long)
The param RGBColor is preset with system value but there you can override the value.
You may use the 'Visited' and/or 'Hot' property of the LlbLink object to finetune further the RGBColor.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
There is a Event for it:
Code:
LinkForeColor(ByVal Link As LlbLink, ByRef RGBColor As Long)
The param RGBColor is preset with system value but there you can override the value.
You may use the 'Visited' and/or 'Hot' property of the LlbLink object to finetune further the RGBColor.
Not an obvious place to set a ForeColor property but it works well. Thanks!
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
AAraya
For example, the Alignment options for LinkLabel should be vbLeftJustify, vbCenterJustify, and vbRightJustify just the Label control. But currently only Left and Right are offered. Is there a reason for this?
Yes there is a reason. Left is by default and Right is achieved by LWS_RIGHT style. There is no native way by comctl32.dll (e.g. LWS_CENTER) to make center alignment.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
There appears to be a bug with Tooltips for the LabelW control. The label caption displays Unicode text but the tooltip does not. See screenshot. Is this a known issue? Let me know if you need more details.
Attachment 163699
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
AAraya
There appears to be a bug with Tooltips for the LabelW control. The label caption displays Unicode text but the tooltip does not. See screenshot. Is this a known issue? Let me know if you need more details.
Attachment 163699
If you use the ToolTipText property, it is normal because it does not support unicode.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Cube8
If you use the ToolTipText property, it is normal because it does not support unicode.
Is this a limitation of the VBCCR.LabelW control or of the underlying Windows APIs which it's built on?
Is there a way around this? One of the reasons I replaced all of the controls in my project to the VBCCR ones was for Unicode support.
-
Re: CommonControls (Replacement of the MS common controls)
Old age has set in... sigh...
I posted this same issue but with a Listbox about a year and half ago. Completely forgot about that. The response was that the TooltipText property does not support Unicode. Man, that's a small nuisance. Any thoughts about adding a TootipTextW property to these controls which can handle Unicode?
In the meanwhile I'll look into implementing my own using this code:
http://www.vbforums.com/showthread.p...iCode-ToolTips
-
Re: CommonControls (Replacement of the MS common controls)
Maybe we should consider overriding VBs tooltips engine like Merri had figured out.
Not sure how you would get around the IDE properties window. Maybe a TooltipW on a property page?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Not sure how you would get around the IDE properties window. Maybe a TooltipW on a property page?
Several options here:
1. Add 7 Properties to each control for full control of ToolTips.
ToolTipTextW, ToolTipTitleW, ToolTipIcon, ToolTipStyle, ToolTipBackColor, ToolTipForeColor, ToolTipMaxWidth
You will need a PropertyPage for ToolTipTextW and ToolTipTitleW so you can add Unicode at design time.
The PropertyPage will need a Unicode aware TextBox to do this.
This seems a bit excessive if you have dozens of controls.
2. Raise an Event via MouseEnter at runtime to request ToolTipTextW and ToolTipTitleW.
3. Set the Unicode via Public Sub InitTooltip at runtime.
Code:
Public Sub InitTooltip(Text As String, Optional Title As String, Optional Icon As ToolTipIcon, Optional Style As ToolTipStyle = ttsBalloon, Optional BackColor As OLE_COLOR = vbInfoBackground, Optional ForeColor As OLE_COLOR = vbInfoText, Optional MaxWidth As Long = 260)
mToolTipText = Text
mToolTipTitle = Title
mToolTipIcon = Icon
mToolTipStyle = Style
mToolTipBackColor = BackColor
mToolTipForeColor = ForeColor
mToolTipMaxWidth = MaxWidth
End Sub
Unicode Tooltips are handled via a class which is instantiated when necessary for each control.
Specifically, start the ToolTip during MouseEnter Event and stop (destroy class) via MouseLeave Event.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
TOOLTIP APPEARANCE QUESTION
The tooltips on TabStripW, ToolbarW and some more are fine, and they support even multiline.
Also the appearance is fine.
Other controls like CommandButtonW, FrameW etc. show different looking tooltips.
Here is an example:
Attachment 162595
Is there any chance to get the same tooltips as with TabStripW etc. in any control?
Thanks.
This topic was already raised several times.
The ToolTipText property of a UserControl is in-built and can't be overrided. Thus a ToolTipTextW property would be needed.
Again, this is only an issue directly on the control.
For example, TabStrip1.Tabs(1).ToolTipText (and other similaries) can handle unicode and multiline text.
-
Re: CommonControls (Replacement of the MS common controls)
Here there is a way to hook the tooltips, but I don't know if that can be of help.
-
Re: CommonControls (Replacement of the MS common controls)
Minor update for the VisualStyles.bas module.
It could happen when having a vbGraphical style CommandButtonW and calling Unload Form on the Click event to cause a crash. (run-time error 438)
Reason was that the internal 'RedirectButton' function in VisualStyles.bas calls the .Refresh method of the button object on WM_LBUTTONUP.
WM_LBUTTONUP causes a WM_COMMAND and the corresponding Click event and if that Click event unloads the form (and ultimately destroys the button object) the following .Refresh method in 'RedirectButton' failed with a crash.
This issue (and possibly other potential messages) got now resolved in VisualStyles.bas.
-
Re: CommonControls (Replacement of the MS common controls)
hi krool ,
I am using textboxw in a usercontrol . It is a custom textbox .
problem info :
1- this problem happens occasionally in the same circumstances every time . I mean sometimes it happens and sometimes it does not .
2- it happens only in a manifested IDE .
3- It happens When I try to click the usercotrol .
In the video link is a description of the scenario .
https://www.youtube.com/watch?v=Jwhs...ature=youtu.be
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool -
2 questions about the TabStrip control:
1) The TabStrip TabBeforeClick event passes a TabItem parameter. I would expect this to be the TabItem of the tab you have clicked (so you can decide whether or not to Cancel the operation based on conditions related to the new tab), but it appears the be a reference to the currently selected tab. Is this by design or is it a bug?
2) Perhaps I'm missing something, but I don't see a way to Disable individual tabs. Is this currently possible, and if not would you consider this for a future feature enhancement?
Thanks, and Happy New Year!
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Hosam AL Dein
hi krool ,
I am using textboxw in a usercontrol . It is a custom textbox .
problem info :
1- this problem happens occasionally in the same circumstances every time . I mean sometimes it happens and sometimes it does not .
2- it happens only in a manifested IDE .
3- It happens When I try to click the usercotrol .
In the video link is a description of the scenario .
https://www.youtube.com/watch?v=Jwhs...ature=youtu.be
the link above no longer works . here is the new link
https://www.youtube.com/watch?v=laFr...ature=youtu.be
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
jpbro
2 questions about the TabStrip control:
1) The TabStrip TabBeforeClick event passes a TabItem parameter. I would expect this to be the TabItem of the tab you have clicked (so you can decide whether or not to Cancel the operation based on conditions related to the new tab), but it appears the be a reference to the currently selected tab. Is this by design or is it a bug?
2) Perhaps I'm missing something, but I don't see a way to Disable individual tabs. Is this currently possible, and if not would you consider this for a future feature enhancement?
First of all, compared to other comctl32 controls the SysTabControl32 is poor developed with not much possibilities.
TCN_SELCHANGING (TabBeforeClick) provides no way to determine which tab is about to be selected. It is a common issue you will find when googling about it.
So there are only two ways to use it:
1. (error in current tab, prevent change)
The TabItem in TabBeforeClick is the item which currently is selected (and not the new one; as not possible)
So you can make a check for the current tab if the content of the shown page panel (or whatever else you display with this tab) is valid. If error/invalid in your app then set Cancel parameter to True and prevent the change. (no flicker)
2. (disabled tab feature = cumbersome workaround with flicker)
Code:
Private LastTabItem As TbsTab
Private Sub TabStrip1_TabBeforeClick(ByVal TabItem As TbsTab, Cancel As Boolean)
Set LastTabItem = TabItem
Cancel = False ' Not applicable to use in this scenario as no way to know new selected tab. (blame MS)
End Sub
Private Sub TabStrip1_TabClick(ByVal TabItem As TbsTab)
If TabItem.Index = 2 Then ' Index 2 is our sample disabled Tab
TabStrip1.SelectedItem = LastTabItem ' If LastTabItem is Nothing then no tab will have focus.
End If
End Sub
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
First of all, compared to other comctl32 controls the SysTabControl32 is poor developed with not much possibilities.
TCN_SELCHANGING (TabBeforeClick) provides no way to determine which tab is about to be selected. It is a common issue you will find when googling about it.
So there are only two ways to use it:
Understood, and thank you very much for the workaround code examples.
PS: I'm providing a link to an earlier post of mine because I didn't hear anything back from you about it. If you don't think the proposed changes are worthwhile/correct that's OK of course, I just wanted to make sure you didn't miss the post: http://www.vbforums.com/showthread.p...=1#post5330725
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Hosam AL Dein
In the form with code it crashes and same controls (copy & paste) to the test form without code it does not crash.
I suggest the problem is in your form code. Please check as this was not visible shown in your video. (Only UserControl was all code excluded by commenting)
Quote:
Originally Posted by
jpbro
PS: I'm providing a link to an earlier post of mine because I didn't hear anything back from you about it. If you don't think the proposed changes are worthwhile/correct that's OK of course, I just wanted to make sure you didn't miss the post:
http://www.vbforums.com/showthread.p...=1#post5330725
Oops. I forgot it. Will take a look soon when time is available.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Hi Krool, I'm using VBCCR16 (1.6.0.12) and have the following problem: during compilation of my EXE the following error message pops up:
Quote:
VBCCR16
Run-time error '0'
I've pasted a screenshot of this below.
There have been NO problems when running from the IDE, and in fact VBCCR has been in use for quite some time without ever seeing this before during compilation.
Any ideas? It is preventing builds...
Thanks!
Dave
Attachment 164453
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
DaveInCaz
Hi Krool, I'm using VBCCR16 (1.6.0.12) and have the following problem:
during compilation of my EXE the following error message pops up:
I've pasted a screenshot of this below.
There have been NO problems when running from the IDE, and in fact VBCCR has been in use for quite some time without ever seeing this before during compilation.
Any ideas? It is preventing builds...
Thanks!
Dave
Attachment 164453
With this information I can't dream the solution.
Please try to bundle this in a demo to isolate the problem.
Do you use any kind of add-ins that might interfere during compilation?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
With this information I can't dream the solution.
Please try to bundle this in a demo to isolate the problem.
Do you use any kind of add-ins that might interfere during compilation?
I totally understand that... I was mainly hoping you might already have familiarity with this. I will try to narrow down what is going on. The build environment hasn't changed in years so I doubt it is an add-in or other tool.
For a long time we used VBCCR14, and more recently updated to VBCCR16. This may have been the first build since that was done.
In the ordinary course of a VB6 build is there any code inside an OCX which would be run during compilation? If so maybe that could provide a hint where to look further. I can see in VBCCR16 source code there is a custom MsgBox function, and from the look of that dialog it seems like it might be displayed using that code (maybe).
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
@Dave
Did you try to compile using the command line?
Like so:
Code:
"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE" /make YourProject.VBP
Just as a test.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
@Dave
Did you try to compile using the command line?
Like so:
Code:
"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE" /make YourProject.VBP
Just as a test.
I use Kinook Visual Build Pro to run the VB6 build, and I believe that is what it does, yes. The same error messagebox popped up when that was running as when I build from the IDE (the screenshot I showed).
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Karl77
@Dave
Did you try to compile using the command line?
Like so:
Code:
"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE" /make YourProject.VBP
Just as a test.
I use Kinook Visual Build Pro to run the VB6 build, and I believe that is what it does, yes. The same error messagebox popped up when that was running as when I build from the IDE (the screenshot I showed).
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
During compile-time custom UserControls are instantiated and read/write properties are fired which might lead to subclassing being setup etc. complications.
I'm using following code to filter compile-time from run-time&design-time and skip subclassing in my custom UCs
thinBasic Code:
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
With PropBag
AutoSize = .ReadProperty("AutoSize", True)
...
End With
If Ambient.UserMode And Not IsCompileTime(Extender) Then
SubClass m_uSubclass, hWnd, ObjPtr(Me), AddressOf RedirectWndProc
End If
End Sub
Private Function IsCompileTime(Extender As Object) As Boolean
Dim oTopParent As Object
Dim oUserControl As UserControl
On Error GoTo QH
Set oTopParent = Extender.Parent
Set oUserControl = AsUserControl(oTopParent)
Do While Not oUserControl Is Nothing
If oUserControl.Parent Is Nothing Then
Exit Do
End If
Set oTopParent = oUserControl.Parent
Set oUserControl = AsUserControl(oTopParent)
Loop
Select Case TypeName(oTopParent)
Case "Form", "UserControl"
IsCompileTime = True
End Select
QH:
End Function
Private Function AsUserControl(oObj As Object) As UserControl
Dim pControl As UserControl
If TypeOf oObj Is Form Then
'--- do nothing
Else
Call CopyMemory(pControl, ObjPtr(oObj), 4)
Set AsUserControl = pControl
Call CopyMemory(pControl, 0&, 4)
End If
End Function
It's a bit hacky and probably can be further simplified.
cheers,
</wqw>
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
With this information I can't dream the solution.
Please try to bundle this in a demo to isolate the problem.
Do you use any kind of add-ins that might interfere during compilation?
Additional detail - this error occurs on our build environment (a Win7-32 virtual machine), but not on another developer's PC.
So there is something environmental which is somehow influencing when the error occurs. I believe i have ruled out disk space (made sure there was at least 20 GB free during the compile).
Could it be some missing dependency? AFAIK both environments have all the same files related to VBCCR.