I'm working on stripping as much other stuff out of my UserControl as I can. Either I'll get to a place where it starts working, or I'll send you a reasonable-sized chunk that shows the problems. Thanks.
Printable View
I'm working on stripping as much other stuff out of my UserControl as I can. Either I'll get to a place where it starts working, or I'll send you a reasonable-sized chunk that shows the problems. Thanks.
Attachment 101639
I'm trying to come in from both sides. I have a very simple test bed (as you mention), and agree that everything works fine there. I'm several hours into cutting out other parts of the real case with no progress. I do see something I don't quite understand: In the attached screen shot, you can see that I added an On Error Resume Next and some debug.prints in your subclassed Window proc, and you can see the results in the Immediate window... After the line
it looks like nothing is executed. Guess I don't really remember if On Error should work inside a subclassed WinProc... but obviously something is going wrong.Code:RaiseEvent ItemClick(Me.ListItems(NMIA.iItem + 1), vbLeftButton)
Hi I'm new here. I've just encountered the same mscomctl.ocx problem that others have been on about for a while. Eventually that brought me here (and what a wealth of useful information I must say).
I'm sorry if I'm being monumentally thick, but I've downloaded the zip file, and compiled comctlsdemo into an exe. The thick bit ... how do I now get to use that in an existing project. I presume I need to include something to replace mscomctl.ocx.
Thanks in advance (and sorry for introducing myself and flagging up my ignorance all at the same time).
Hi, I've recently encountered the mscomctl.ocx problem having just revisited an old VB6 project I need to upgrade.
Eventually that brought me to this form - and a wealth of knowledge and useful info I must say.
Sorry, but I'm being monumentally thick here, I've downloaded the zip file and compiled the project into an EXE. How do I now use that in my own project as a replacement for the common control that aren't working.
Thanks in advance and apologies again for introducing myself with what is probably a very simple question.
Copy/Move the following files and folders to a new folder:
- [ListView]
- [ProgressBar]
- ComCtlsBase.bas
- Common.bas
- VisualStyles.bas
- VTableHandle.bas
- Enumeration.cls
- ISubclass.cls
- VTableSubclass.cls
Finally, copy/move the OLEGuids.tlb file to the "Windows\System32\" directory and set a reference to it through the VB6 IDE's References dialog box.
EDIT
Of course, you'll have to import all of those files into your project (except for *.CTX files). The easiest way of doing that is to drag and drop them onto the Project Explorer window.
Thanks for the reply.
I've included the .bas and .cls files into my project and the OLEGuids.tlb files into system32.
(I've figured out how to register it now).
Next problem is that I was expecting to be able to drag-n-drop lstView and ProgressBar1 object to my form(s) to replace the old ones.
I think I'm just not understanding how these new controls work.
To replace your old controls, copy their names first and then delete them from the Form. You should be able to see the new User Control's icons on the Toolbox. Add them to the Form either by double-clicking or clicking and drawing them on the Form. Rename them using the names of the old controls. Every property, method and event of the old controls should continue to work as they did before. If not, then post here the issues you've encountered.
I see. I think I've got there now. I'd missed the need to drag the contents of the Builds/ListView and Builds/ProgressBar (excluding the CTX) into my project.
The controls are now there and I've successfully replaced my old ones with them.
I've also removed mscomctl.ocx so I've definitely replaced ALL instances of the old controls.
> If not, then post here the issues you've encountered.
When I try and compile, I get the following compilation errors using listView....
The types ListItem and ColumnHeader do not exist for the ListView control
The column alignment constants are missing for lvwColumnLeft, lvwColumnCenter and lvwColumnRight
Also, when trying to save and exit the project, I hit the CreateSubclass debug.assert in VTableSubclass when trying to save the form with ListView on it.
I have to say, if I can get over these errors, then this is a great replacement for mscomctl. krool should geta medal :)
You can also include the CTX file into your project. (It contains a custom toolbox bitmap for displaying a ListView symbol in the components tab)
You have to make some renamings. For instance "Dim Test As ListItem" would then be "Dim Test As LvwListItem" or "Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)" would then be "Private Sub ListView1_ColumnClick(ByVal ColumnHeader As LvwColumnHeader)"
The constants are also different. In your case you need to rename lvwColumnLeft, lvwColumnCenter and lvwColumnRight to LvwColumnHeaderAlignmentLeft, LvwColumnHeaderAlignmentRight and LvwColumnHeaderAlignmentCenter.
This always happens when the IDE crashed and is supposed to be.
Hi Krool nice to meet you, this is a very nice and large project, contains 33.760 lines of code. I have a tools for formatting VB6 code maybe worth for you thanks. http://www.vbforums.com/showthread.p...ode-Formatter)
Thanks krool, I've made these changes and got everything compiling.
(It wouldn't let me drag the ctx into the project though - not important)
One final question, in debug mode I seem to hit this assert every time I run, and I have to close down VB and re-open the project to re-run in debug. Is that correct, and what would cause the IDE to crash?
This is just me running my app in debug, and closing it down at the end. The only thing I can think is that I try to compact the attached database and this fails depending on what version of Access is in use, but I've got this trapped behind "on error goto"....
On Error GoTo CompactDBFailure
DBEngine.CompactDatabase sDBCopyName, gDataBaseLocation
On Error GoTo 0
Is there a problem is just commenting out the debug.assert line ?
Don't import it. Just copy it to the same folder as the ctl file than it should work.
Is this also happening in the demo project?
If you comment it out then the IDE is immediatly crashed. Without leting have you a chance to still save the project. (it will fire the debug.assert again when saving, but it is saved)
Thanks krool.
The assert is hit whenever I close after failing to compact the DB. If I remove the compaction code, it doesn't occur.
It does not happen with the demo project.
Update released.
OptionButtonW control is added. (Unicode)
It can be combined with the intrinsic VB OptionButton.
Superb work! You really should post this in the coding contest!
Thank you for this release. OptionButton not enough options for multi-line text or wrap text by default if it is not included in the controller. Standard control VB can do
Kroll, You can extend the functionality of ProgressBar?
It would be nice if the progress bar for added display of progress on the taskbar. An example can be found here http://sourceforge.net/p/audica/code...skBarList3.cls
See the DispInvokeDemo.zip linked here.
A Transparent property can be added to CheckboxW and OptionboxW? And to complete the set, not enough of the control LabelW, also with options wrap and transparent
At the moment I use similar control from the user Truong Van Hieu site PlanetSourceCode.
Thank you, your set can now replace many of the old well-known sets of controls.
Compiling the VBP project ends up with an error (343): object is no array (translated from german error description).
in module: Common.bas
in line 128: Index = Control.Index
Any idea?
Regards,
ZZap
Updated released.
All controls should be now truly unicode.
Anyway to fix the password in the textbox to reflect the later style password text with dots instead of asterisks?
So I did notice that some of the settings don't save when you compile. For instance if you change the password char to whatever and you click build it will not have a password char in the exe. If it is set through the form like you stated above it works ok.
This demo is showing of how to make the ToolBar accessible per shortcut key when it is placed on a MDIForm.
It is a little bit more work as the MDIForm does not have a KeyDown event.
The password char for dots "ChrW(&H25CF)" cannot be set at design time. (only at run time as stated above)
I have therefore now included a "UseSystemPasswordChar" property to the TextBoxW control. When set to true then the control will be created with the style bit ES_PASSWORD and thus display asterisks or dots as password text automatically (depending on the comctl32 version) .
Awesome work as always! I still have an issue when compiling where it does not save the changed settings. If I open the project. Change the textbox at the bottom via properties to systempasschar and click compile. The progress bar goes as if it is compiling but once it reaches the end it refreshes the project and the settings don't stick. The exe does not reflect the change and the project in the ide changes back to default text.
Dear Krool, could you add to its control (OptionButtonW and CheckBoxW, CommandButtonW) parameter Transparent, to the BackColor property itself became equal to the parent. But it is also possible for the elements of a ProgressBar and CommandButtonW fix the appearance of unpainted parts, or as a backcolor, or add an option RoundCorner, to be able to make a rectangular controls, thereby remove the unfilled elements.
Attachment 104331
Can someone tell me how to auto size columns based on items in listview?
You can set the BackColor property manually, so that it matches to the Parent's BackColor.
For example in Form_Load event:
Do following: (where Index is the column you want to auto size)Code:Private Sub Form_Load()
CommandButtonW1.BackColor = Me.BackColor
CheckBoxW1.BackColor = Me.BackColor
OptionButtonW1.BackColor = Me.BackColor
End Sub
Code:ListView1.ColumnHeaders(Index).AutoSize LvwColumnHeaderAutoSizeToItems
Update released.
Transparent property included to CheckBoxW, OptionButtonW and CommandButtonW.
But it is not a real transparency. Each time when the underlying background may change you need to call .Refresh.
In the new release there is also a demonstration of how to make the transparency work when a control (for e.g. CheckBoxW) is placed on a TabStrip control.
Update released.
Remake of the FrameW control. There should be no bugs anymore.
I use the control jcFrames from site planet-source-code.com (http://www.planet-source-code.com/vb...64261&lngWId=1), when I add your control LabelW, and after change property BackStyle = 0 (Transpapent), I see a small graphic bug on the element jcFrames. Tell me why this might be, and you can somehow fix it?
I attach a test project where I showed this nuance
Do you have plans on recreating the File Open/Save dialogs?
[edit]
Also, do you have plans on releasing a DLL version of the controls?
You can fix that small graphic bug by including following at the end of the "PaintFrame" sub in the jcFrame control:
I don't think that I will make a "CommonDialog" control as it can be replaced easily by some API calls. There are enough examples out there.Code:Private Sub PaintFrame()
' [...]
Set UserControl.Picture = UserControl.Image
End Sub
Maybe I will provide some day such a converted project, as there are really some big advantages.
However, you can convert this project to an ActiveX Control for yourself.
Just ensure that you start a new ActiveX Control project from scratch instead of directly converting the CommonControls project. The classes need to be public and the enums located in the ComCtlsBase.bas need to be shifted to a public class. I have tested it and by this way I did not encounter any problems.
Is it possible to do the same thing with the Microsoft Hierarchical FlexGrid and the normal FlexGrid control?
Control ComboBoxW for events, substitutes the previous value. For example, when you select an item from the list (Event Click), the value of the Text, is not for the selected item, and the previous item in the list.
In native controller from the MS is not
Krool, you have in your kit use for string operation some slow Variant functions - Chr, ChrW, String, Mid, Left, Right, Format, Ucase, Replace, Dir and e.t.c . To increase the speed, i think it is necessary to replace them with their string equivalents function (Chr$, ChrW$, String$, Mid$, Left$, Right$, Format$, Ucase$, Replace$, Dir$). This has a positive impact on the speed of some of the elements.
Is there any way to get your demo running in VB5 ?
Attachment 106707
OK - Guess I'll start looking for a second hand VB6 (again!)
Update released.
Krool, please tell me how to handle the event RichTExtBox clicking the link above.
Event found LinkEvent, but for some reason it does not work
Also, In the example RTF, there is a small error
Private Const MFS_DISABLED As Long = &H3
Can you please enhance Richedit to support pictures (Insert/Resize/Delete/Positioning) and editable table?
Are you saying the LinkEvent never fires? Ensure that the AutoURLDetect property is set to true.
What do you mean with small error? The Const value is correctly set to &H2.
Do you mean "Insert/Resize/Delete/Positioning" by code?
Actually according to the MSDN site it should be &H3.. http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
Quote:
Originally Posted by Jonney View Post
Can you please enhance Richedit to support pictures (Insert/Resize/Delete/Positioning) and editable table?
Yes,sir. How to manipulate pictures and tables in Richedit is a difficult part for ordinate VB programmer. I know my request is beyond the topic, but if you have something on hand, please make a simple demo. Thanks.Quote:
Do you mean "Insert/Resize/Delete/Positioning" by code?
Got Myself a copy of VB6...
Just wanted to say "Thank you soooooo much" - I've been wanting to add unicode support for years and never could!
@Krool
First off - great work, thanks for such a comprehensive project!
Second - I have a need for a Unicode RichTextBox control, so I thought I give yours a try. Everything seems to be working pretty well except that if I host your RichTextBox control on another UserControl then the cursor keys don't seem to work any longer. Is there anything special I need to do to get them working on a UserControl, or is there a bug?
Thanks again!