removed
I can't reproduce that. Please provide more details.
Printable View
Is there anything dangerous/wrong with the VTable subclass approach?
(I ask because now I'm sticking to the older version that use that technique)
Thank you for the tip, in case I decide to use the latest version.
What are the IOleControl features, something related to navigating with arrow keys?
When clicking the "Rich TextBox demo" button, it loads RichTextBoxForm and at the end of the Form_Load it is the line:
since RichTextBox1.SelFontName is not null, it tries to set "MS Sans Serif" to FontCombo1.Text, but FontCombo control's property Text is read-only. Hence it raises the error at the line:Code:If Not IsNull(RichTextBox1.SelFontName) Then FontCombo1.Text = RichTextBox1.SelFontName
Code:Err.Raise Number:=383, Description:="Property is read-only"
Hi All,
I am trying to extract icons from DLL file and add them to ImageList and then show them in ListView. The code is as follows:
It works...randomly - sometimes I have all the icons, sometimes not; after a listview refresh, sometimes they disappear; after a few refreshes, they come back again eventually. Picture1 always receives the icon, no matter if it's from the function or from the ImageList.Code:ListView1.ListItems.Clear
ImageList1.ListImages.Clear
ImageList1.ImageHeight = 32
ImageList1.ImageWidth = 32
ImageList1.ColorDepth = ImlColorDepth24Bit
For i = 0 To UBound(arrSomething)
Picture1.Cls
Picture1.Picture = GetIconFromFile(arrSomething(i).IconPath, True) ' Yep, the extracted icon is correct
ImageList1.ListImages.Add i+1 , , GetIconFromFile(arrSomething(i).IconPath, True) '<- this function return large icon as StdPicture
' ImageList1.ListImages.Add i+1 , , Picture1.Picture ' Just for testing - works but randomly
' Picture1.Picture = ImageList1.ListImages(i + 1).ExtractIcon ' This works always
With ListView1.ListItems.Add(, , arrSomething(i).Name, i+1)
....
End With
Next i
Am I doing something wrong or it's a bug in the ListView?!
Thank you.
Update released.
Improvement (cosmetic, not a bug) in VTableHandle.bas so that IOleControl do not disturb anymore in IDE on debugging.
Setting breakpoints (F9, F8 etc.). This cosmetic issue only affected the Std-EXE version and NOT the OCX.
You know what? This issue is resolved. :) It was easier than I thought and pretty straight forward solution.
So, there is nothing issue for you to update everything to the latest version.
I described this in post #2472
Just ignore the tip, as it's resolved. I deleted the tip to avoid confusion.
In fact the FontCombo.Text is not always read-only. It's only when there is no match in the list.
This behavior is the same as in the VB.ComboBox.
Here is a portion of the Text property in FontCombo:
As you see, it's only read-only when CB_FINDSTRINGEXACT returns CB_ERR. So in other words, "MS Sans Serif" is missing in your FontCombo1 list.Code:Case FtcStyleDropDownList
If FontComboHandle <> 0 And FontComboDesignMode = False Then
Dim Index As Long
Index = SendMessage(FontComboHandle, CB_FINDSTRINGEXACT, -1, ByVal StrPtr(Value))
If Not Index = CB_ERR Then
Me.ListIndex = Index
Else
Err.Raise Number:=383, Description:="Property is read-only"
End If
Else
Exit Property
End If
I don't have the issue because in my FontCombo1 "MS Sans Serif" is contained.
Can you please check which fonts are in your list and if "MS Sans Serif" is missing?
Great!, thank you very much Krool :thumb:
MS Sans Serif is not on the list of the FontCombo control, but it is on the font list of other programs such as Notepad.
I'll try to investigate the code to find the cause why it is skipped, but I'll do it later.
I'll update this post then. (*)
(I think that font is a type of font that is not vector based, that might be the cause -just a guess-)
* Update: I found that the cause was that I have Windows configured as the language for non Unicode programs to Hebrew (because I'm working with some right-to-left issues in my program).
As soon as I changed the Language back to Spanish, the MS Sans Serif font got listed on the control.
Studing the code, I found that while Windows is configured to display Hebrew, the EnumFontFamiliesEx API does not list the MS Sans Serif font. But other programs list it and it is available on the system.
It turned out my issue was with 32-bit pictures. VBCCR16 was failing with runtime error 50003 when I tried to open the form, but when I tried to load 32-bit images in a clean project, I got an "invalid picture format" error. Not a big deal; I don't need XP to work anyhow.
krool,nice job,I am trying to get Msgbox text,But get null,thank you!
Private Sub CommandButtonW1_Click()
kkk
End Sub
Private Function kkk() As Long
Dim Result As Long
Dim strErrMsg As String
Dim intOldMousePointer As Long
On Error GoTo errHandler
intOldMousePointer = Screen.MousePointer
Screen.MousePointer = vbHourglass
Result = -1
If Result = -1 Then
Err.Description = "this is test"
GoTo errHandler:
End If
errHandler:
Screen.MousePointer = intOldMousePointer
strErrMsg = Err.Description
On Error Resume Next
MsgBox strErrMsg
End Function
You raise an error by calling err.raise and specifying the error number.
Nothing to do with Krools Common Controls
thanks Arnoutdv
add code: debug.print strErrMsg,the strErrMsg is null(use vbcc CommandButtonW)
add code: debug.print strErrMsg,the strErrMsg is "this is test"(use vb CommandButton)
I get the reason,"Screen.MousePointer = intOldMousePointer",it created some mouse messages,and WindowProcControl received the mouse messages。I have solved the problem(use SetCapture、ReleaseCapture)。
Hi Krool
Please how to change the Statusbar Backcolor property ?
Hi Eduardo
Yes this works but the SizeGrip Backcolor remain unchanged !
If you need only the SizeGrip and not the whole StatusBar, you can use this control.
Krool,
a little difference between ComboBoxW and the standard control: you can not perform ".Additem vbNullString", it raises a strange error.
It's not a problem, to solve it is enough to use an empty string (""), I just want to let you know.
Like Eduardo suggested. You can use a special "SizeGrip UserControl".
I also posted a SizeGrip control here in the forum long time ago which draws on comctl32.dll (either themed or not, depending on manifest) and contrary to Eduardo's solution does not depend on static images.
My control was updated now to include a BackColor property. (SizeGrip; see link above)
Good point. I was not aware that CB_ADDSTRING or CB_INSERTSTRING returns CB_ERR when the string pointer is 0..
However, I added following check now inside the AddItem method to avoid such a situation in the ComboBoxW. (update released)
Code:Public Sub AddItem(ByVal Item As String, Optional ByVal Index As Variant)
[...]
If StrPtr(Item) = 0 Then Item = ""
Hi Krool ,
1- In previous posts here , there was a discussion about who is responsible for calling the SetupVisualStyles method and you said that it is the EXE`s responsibility not the ocx . But there is a question here , What about the controls created at runtime ? . I the have to recall the sub again after loading them . This seems normal in simple cases (low repetitive calls , not many controls , the loaded controls are in a form .. etc) . But there are some other cases where calling this method is tricky and overhead like if there are too many controls(loaded in runtime) or when calling this sub for many times depending on the control load logic and behavior in the code and also when these newly created controls are in a nested user control or non-nested one . All the previous cases have a workaround and can be done . But just a thought if it can be handled or being re-thought about this case .
2- In Dtpicker , while formatted for time and the digits are displayed in Arabic with SegeoUI font , the hours panel is not fully displayed . When the hours are represented in two digits like 12 or 13 etc , the digit 1 is not at all visible . If for example the hour is 23 , the digit 2 is partially visible and so on .This happens only in digits in Arabic format . So , The area for the hours panel is not drawing correctly in this case .
3- About TextBoxW Balloon Tips , It only shows the balloon for the last textbox . Can this be solved ? . I know this is because it should hide when the text box loses the focus and this is the case when showing these tips .
If it can be handled without changing focus or capture state it will be nice because it also has some disadvantages . The first one is mentioned above : is that the they can not be shown simultinously .And also , they force the text box to fire both LostFocus and GotFocus events too many times which adds overhead especially when these events contain some code (Like in my case) .
I used debug.print in both LostFocus and GotFocus events for the TextBox when showing the balloon tip and the result was as following :
exit
enter
enter
exit
enter
exit
Besides overhead , There is something which is more dangerous that is firing SetFocus event two times one after another which can not happen in normal behavior. Most of code that is placed in gotfocus event is sometimes related to lostfocus event as it is always expected that when gotfocus event is fired , it will never be fired again until it loses the focus .This double call caused a lot of problems in my case and I have just figured out the reason . So , If it is possible for balloon tips to implemented without dealing with setting and releasing the capture , it will add many advantages (Showing many ones at the same time - reducing overhead - solving the double calls for set capture - saving performance by eliminating multiple calls for LostFocus and GotFocus events too many times ) .
Thanks a lot for you effort .
Is anyone else experiencing the problem that text inside TextBoxW with alignment set to vbCenter does not get centered?
Attachment 174555Code:TextBoxW1.Text = "this should be centered"
TextBoxW1.Alignment = vbCenter
Works for me in Windows 10. Checked running in the IDE and design mode with the OCX version.
Windows XP, Home Edition, SP3, version 2002.
Using VBCCR16.OCX 1.06.0061 3af959d
Update released.
I noticed in a new form-less application that CommonDialog.ShowPrinterEx was not working and raised the error "The PrintDlgEx function failed during initialization." with the error value E_HANDLE.
The CommonDialog.ShowPrinter was not affected.
It turns out that the PrintDlg API can deal without owner window whereas on PrintDlgEx the owner window member value cannot be NULL. It returns E_HANDLE when it's NULL.
The internal function to get the owner window in CommonDialog is as following:
So in a form-less application GetOwnerWindow() is NULL.Code:Private Function GetOwnerWindow() As Long
Dim hWnd As Long, hWndMDIClient As Long
hWnd = GetActiveWindow()
If hWnd <> 0 Then hWndMDIClient = FindWindowEx(hWnd, 0, StrPtr("MDIClient"), 0)
If hWndMDIClient <> 0 Then
Const WM_MDIGETACTIVE As Long = &H229
GetOwnerWindow = SendMessage(hWndMDIClient, WM_MDIGETACTIVE, 0, ByVal 0&)
Else
GetOwnerWindow = hWnd
End If
End Function
As the other common dialog boxes accepts a NULL value and only PrintDlgEx being an exception I keep GetOwnerWindow() unchanged and do a workaround in the ShowPrinterEx function only, as following: (code in blue is new, added)
Also, which I was not aware of, is that .ShowPrinter (PrintDlg) looks different in a form-less app than in a normal form app. (difference being owner window NULL or not)Code:.hWndOwner = GetOwnerWindow()
If .hWndOwner = 0 Then
' According to MSDN:
' This member must be a valid window handle; it cannot be NULL.
' The PrintDlgEx function will return E_HANDLE when this member was NULL.
.hWndOwner = GetDesktopWindow()
End If
PrintDlg (Valid owner window)
Attachment 174583
PrintDlg (Owner window NULL)
Attachment 174581
hi Krool
Whether next version can support the following
http://www.vbforums.com/showthread.p...oplist-problem
Krool,
I too have a request. Hopefully it isn't too much work. VB6 provides a horizontal and vertical scrollbar for dropping onto your form, however, they don't seem to respond to mouse scroll wheel movement natively.
My form has your treeview and slider controls, both of which respond to mouse scrollwheel movement (a quick aside - when the treeview's contents extend in x/y beyond the control's boundaries, your treeview only responds to vertical scrolls even when the horizontal scrollwheel has the focus, same as .NET). Regardless of any perceived inconsistency there, that is all well and good for me. I am very impressed by the treeview control.
My form also uses the VB6 native file listbox which strangely already responds to mouse scrollwheel events. Even better.
https://i.imgur.com/sW0Bexf.png
The trouble is that I also have a pseudo-thumbnail view and use both a horizontal and vertical scroll bar, one to navigate through my icons in that thumbnail view and the other horizontal one, to scroll an icon map. Neither of these two standard VB6 scrollbars respond to mouse scroll wheel movement and as a result these controls are inconsistent with the rest of the form.
https://i.imgur.com/mZiNCSz.png
My VB.NET version, of course handles all mouse scroll wheel movements as the user would expect but I prefer the VB6 version and I want it to operate as well as the VB.NET does.
So, my request is: Can you please create the vertical/horizontal scrollbar controls and add them to your collection? I think it would be a useful addition, certainly for me.
We could call them SKroolbars...
How about updating Horizontal Scrollbar via MouseWheel when Kybd Shift is pressed.Quote:
your treeview only responds to vertical scrolls even when the horizontal scrollwheel has the focus, same as .NET).
That is how it works on Web Scrollbars.
See ucScrollbar control where Kybd Shift has been implemented for Horizontal Scrollbar.
http://www.vbforums.com/showthread.p...=1#post5437197
I could do that but I prefer scrollbars to operate as they should and just as they do in other apps and also how they operate in the .NET version of the same application.
Also, bearing in mind what I said in my request, that the other scrollbars are all functioning just as they ought. It is just these two native scrollbars that do not. It would be logically more sensible to fix the two bars that aren't functioning as expected, rather than have to work on all those that are working correctly in order to make them operate differently and counter-intuitively to most user expectations.
Hello Krool, I want to ask you what is the purpose of your MsgBox overwrite function:
Thank you.Code:' (VB-Overwrite)
Public Function MsgBox(ByVal Prompt As String, Optional ByVal Buttons As VbMsgBoxStyle = vbOKOnly, Optional ByVal Title As String) As VbMsgBoxResult
It is Unicode.
If you sort your controls alphanumeric in the Vbp file they will appear sorted in the ToolBox.
Actually, I usually sort the entire block containing Modules/Classes/Controls/PropertyPages to make the Vbp more readable.
Is it possible to make a list (listview?) where a row spans multiple lines, possibly using different formatting for some elements?
An example:
Attachment 174629
Note that the second row is selected, and the name is in bold.
this is where ownerdraw come into play
on the listbox (and some other controls) there is a DrawMode property and corresponding events.
although I can not see these on the listview control, maybe krool will decide to add it at some point.
you could still use the windows api to do it
Replacing the intrinsic VB functions form the OCX would be possible using ASM code.
Last time I tried it the sample wouldn't load. I don't think they are really trying to make something people can use. Just tech types having fun I think.
I don't think you are correct there old chum. You may need some guidance on getting it to work for you but your current attitude is akin to going to the doctor once and saying, "I tried some medicine once and it didn't work. I don't think they are really trying to make people better. Just medico types trying to look important I think."
The demo still doesn't run. Not saying it's impossible to get it to run. But normally you run a demo - it doesn't work - you give up and move on. I asked about it, googled, tried a few things - more than most people would ever bother doing - and it still doesn't run. So for sure it's a terrible demo that makes the entire project look bad. And it's still in the first link here. If people are serious about a project they make sure the demo works. If they are just tech types having fun then they don't care. I get the feeling that's the case here.
I'll show you what people see when they run this project...
Attachment 174649
I think I found the problem here:
Attachment 174647
So you do some digging, find the missing file (it's actually hidden inside the demo if you know where to look)... you fix that problem and you are still no further ahead because of THIS issue...
Attachment 174651
Long before this point most people would just give up. As I said.. not really a criticism... just an observation. But this isn't a project where the author is trying to make something useful for most VB programmers. He's having fun doing something he enjoys. Great for him. Unfortunately a potentially great and useful project is ruined by a non functional demo.
Out of curiosity.. what the heck is "a manifest specifying comctl32.dll version 6.0 or higher" and where would a person get one?
I found the VBCCR OCX in another thread and registered it and loaded it up to test. Some of the controls do work but about half of them say something like:
"The linkLabel control requires at least version 6.0 of comctl32.dll".
I have the version from SP6 so shouldn't it be the right version? And isn't the entire point of this project to get away from comctl32?
Attachment 174653
And then the project wants me to make a manifest for VB6... * sigh * Time to give up again. But as I said last time, it's an interesting project. Hopefully some day somebody can get the demo to work right.
It's modern nowadays to give up immediately on first problems instead to read the notes or make some research?
If youwould read the notes in the first thread you would know to make following setting;
Goto menu Tools -> Options... -> General -> Error Trapping.
"Break on Unhandled Errors" should be selected instead of "Break in Class Module".
This is some odd default setting of VB6 whichI can't do something about. However, it's s one-time change in settings and then OK for the end of life of that installation.
Now the demo runs.
About the rest make some google research about manifesting and theming.
It's optional, when you don't want full features you not need to manifest. It's not my restriction. It's windows.
comctl32.dll is a windows system file, and not an MS OCX. The .dll is part of the core and always pre-installed.
Please don't post such statements with "half knowledge".
If it's too overwhelming for you just move on.
It's the responsibility of the >>EXE<< to make such things. It would be ridicolous if an OCX overwrites VB functions without any control and with ASM hacks..
Well... that did change things. Now the whole IDE just closes and exits without any error message. But the demo still doesn't run.
Just to make sure it wasn't just this new laptop I'm having troubles with I downloaded the demo and ran it on another computer. Identical result. Press Run and * poof * the IDE closes and exits. No error message. Just gone.
Best of luck on what looks like a very powerful project with a lot of potential. I'll be sure to keep an eye on this thread and see what happens in future.
It is your component, you do whatever you want.
But you cannot state it as a general rule, because it can be done and it works without problem.
Again, it is your opinion, your project, your decision.
I thought it could be a good idea to offer that possibility, since your project mainly seems to be intended to upgrade VB6 bringing Unicode support to it (and other things), and leaving those intrinsic VB Functions in their ANSI version somewhat undermines the goal.
I think for that reason you added them to the exe version.
But if you are afraid that it could cause any problem, I understand.
Or whatever reason that you have to think so.
I just suggested it as a possibility, nothing more.
I realize that you don't like contributions (or opinions).
OK, no problem.
Try this . Add this manifest to your VB6.exe . I used ResourceHacker to update it .
I am using the OCX version , and I always combine the following files to the project > Most of them are oriented to visual styles issue .Code:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--This Id value indicates the application supports Windows Vista functionality -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--This Id value indicates the application supports Windows 7 functionality-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--This Id value indicates the application supports Windows 8 functionality-->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--This Id value indicates the application supports Windows 8.1 functionality-->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
</application>
</compatibility>
<assemblyIdentity type="win32"
name="myOrganization.myDivision.mySampleApp"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="0000000000000000"
/>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
</assembly>
1- VisualStyles.bas
2- Common.bas
3- Resource file and following is its content :
4- In each form_load event , add this lineCode:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--This Id value indicates the application supports Windows 8 functionality-->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
<assemblyIdentity type="win32"
name="myOrganization.myDivision.mySampleApp"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="0000000000000000"
/>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
</assembly>
Code:SetupVisualStyles Me
First, thanks very much for your suggestions. Very helpful. I realize it's not your job to spoon feed me so I'll try to figure out how to add a manifest to VB6. Last time I tried... it didn't end well. But I'm up for another try. But any idea where a person would find VisualStyles.bas and Common.bas?
Don`t mention it .
. Download the demo found in the first page of this thread . You will find them in the Common folder .Quote:
But any idea where a person would find VisualStyles.bas and Common.bas?
Now you have the most recent version of VBCCR controls . The function SetupVisualStyles I mentioned above is updated to SetupVisualStylesFixes . (I have not yet upgraded to the latest version therefore I wrote the name I am still using) . See this post http://www.vbforums.com/showthread.p...=1#post5444619 .
About Manifesting VB6 Exe , Download ResourceHacker . File > Open .. Browse for VB6.Exe > Open the Manifest node > delete all text > Paste the text provided above > Press the green arrow button Compile Script Then save it > Replace the old VB6.exe with this one . That`s it .
Keep your old VB6.Exe in the same directory with another name in case of any failure . If you encountered permission error saving the new exe in this location , then save it in any other location then copy>paste it manually . Start IDE , you will notice that it is themed (If everything is ok) . One clear sign for that is you will not find any colors in the palette tab while setting the back color - (or any property dealing with colors) - property of any control from properties window .
There is a bug in the LabelW control in the DoAutoSize procedure.
The line:
Should be changed to:Code:.Extender.Move .Extender.Left, .Extender.Top, .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize), .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
Code:If PropWordWrap = True Then
.Extender.Move .Extender.Left, .Extender.Top, .Extender.Width, .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
Else
.Extender.Move .Extender.Left, .Extender.Top, .ScaleX((CalcRect.Right - CalcRect.Left) + (BorderWidth * 2), vbPixels, vbContainerSize), .ScaleY((CalcRect.Bottom - CalcRect.Top) + (BorderHeight * 2), vbPixels, vbContainerSize)
End If
Sorry , I produced the steps above by opening a manifested exe while in your case it is not . So , yes , you will not find this node as your exe is still not manifested yet .
Anyway ,
Action > Add from blank script > ((then a clean window opens - paste the manifest text in there )) > Compile green button > Save
You don’t have to embed the manifest (I would advise against modifying vb6.exe in any way). Just place the .manifest file next to the .exe file and restart the OS. The last step is required for the manifest cache to be cleared and is usually not heeded and then someone declares in the forums external manifest is not working.
You can clear the manifest cache for vb6.exe by changing its last modified date with touch.exe utility or similar too.
Ah! Well.. that seems to work. But just a question... what does this all do?
In my case I did notice the IDE showed a few minor changes to bold text but not much else.
The only thing I noticed on my own existing VB project was that the background color for the drop-down combo box changed from green to light grey. Not sure why that would happen.
Is there some benefit I'm not seeing? Or does the benefit only happen when you start using the replacement controls?
OMG it works. The demo actually works!!! Hosan Al Dein showed the way with his brilliant post about adding a manifest into the VB6.EXE file... and presto. The demo finally works! Might be an idea to edit post #1 and add this info. Now I can finally see what you guys are talking about.
Attachment 174693
Because it's not needed. Why would I want to modify the compiler just to run the IDE manifested if I don't have to?
Of course vb6.exe is not digitally signed nor is it a protected OS file so there are no "defenses" against corrupting it yourself at will.
Why does Resource Hacker always create a backup file next to the modified executable? Obviously fiddling w/ PE files this is not as reliable as adding/removing "resources" to a .zip file -- never seen 7-zip creating backup files when modifying an archive.
cheers,
</wqw>
Several years ago I used an embedded Vb6.exe Manifest until I managed to corrupt Vb6 after a fresh install of Windows.
Since then I always use an external Manifest "Vb6.exe.manifest".
I did have to make a registry change so that it is recognized.
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide
Value(REG_DWORD): PreferExternalManifest
Data: 1 = prefer, 0 = don't prefer
--
A .Refresh on the status bar wipes out the text. That doesn't seem correct.
I'm just using it as a single StatusBar, and using the SimpleText property.
I'm also using the source code version, and just including it in my project.
Here's the code I originally had:
Code:
Public Sub UndoChanges()
' Careful, FilePath and FileName shouldn't be undone.
'
If miUndoCount = 0& Then
SetStatus "There are no remaining undo points."
Sleep 200
SetStatus "There are no remaining undo points."
Sleep 200
SetStatus "There are no remaining undo points."
Sleep 200
SetStatus "There are no remaining undo points."
Exit Sub
End If
'
End Sub
Public Sub SetStatus(sText As String):
StatusBar.SimpleText = " " & sText
StatusBar.Refresh
End Sub
I just wanted it to blink a bit.
If I comment out the StatusBar.Refresh line, the text doesn't get cleared, but I don't get my blink.
-----
Actually, I was hoping for a .ForeColor (or maybe .FontColor), so I could blink it red, but that wasn't an easy option.
But I suspect, even with that, I'd still have a problem making it blink, which I want.
--------
EDIT1: Ok, I was being a bit dense. I needed something like the following to get my blink.
And that actually worked, blink and all.Code:
If miUndoCount = 0& Then
SetStatus "There are no remaining undo points."
Sleep 200
SetStatus vbNullString
Sleep 200
SetStatus "There are no remaining undo points."
Sleep 200
SetStatus vbNullString
Sleep 200
SetStatus "There are no remaining undo points."
Sleep 200
SetStatus vbNullString
Sleep 200
SetStatus "There are no remaining undo points."
Sleep 200
SetStatus vbNullString
Sleep 200
SetStatus "There are no remaining undo points."
Exit Sub
End If
I think my question still stands though. A .Refresh is suppose to clear the text?
My point exactly: *this* is the kind of cargo-culting in this thread that my duty called. . .
https://imgs.xkcd.com/comics/duty_calls.png
No need to change this reg key. Just create the the vb6.exe.manifest and then restart the OS :-))
cheers,
</wqw>
When using .Style = Normal you can use the .Panels(Index).ForeColor property.
A .Refresh should erase the text? I can't replicate such thing.
Thanks, your right. Update released.
The demo should also works without manifest. At least it does for me.
Attachment 174701
Really glad to help , Darkbob .
The benefit is you can see visual styles applied to the controls in design time . So , As Krool mentioned , you can still ignore this option and you will see visual styles applied after you compile your project (not in design time) if you did one of the following : 1 - you have a manifest embedded in your resource file 2 - you provide external manifest to your exe .Quote:
Is there some benefit I'm not seeing? Or does the benefit only happen when you start using the replacement controls?
This is a general rule that has nothing to do with VBCCR controls . But why is it around here in VBCCR ? because VBCCR support visual styles . So , we add this manifest to see this effect . Adding manifest to vb6.exe or your exe is optional unless you use some VBCCR features which require a manifest that supports Common Controls 6 or higher .
So to conclude , Manifests do many things . One of them is to provide visual styles ability .
You can use them externally by adding the manifest text in an external file with the same name as your exe and with .Manifest extension and some tweaks in your OS . Or you can use them embedded in your exe like what you have done in your vb6.exe .
Why did we add a resource file to the project ? Because we need this manifest to be compiled with the exe .
I hope I could make it clear for you as English is not my first language . Have a nice day .
Edit 1:
Some posts are ignored in my reply .
Edit 2:
This post does not answer the question that you may ask : Why did this manifest solved the problem if its only purpose in this project is to see visual styles effects in design time ?
I can guess an answer but still not pretty sure about it .