There is already a AutoSize method in the ColumnHeader, just in case you oversaw it.
Anyhow, will check your other suggestions soon.
Thanks
Printable View
LVSCW_AUTOSIZE and LVSCW_AUTOSIZE_USEHEADER are entirely different than LVS_EX_AUTOSIZECOLUMNS, the latter prevents resizing to 0 (exact size is auto adjusted to the presence of image, checkbox, split button or filter too), automatically scales all columns as the ListView is resized both smaller then larger again, and is required to set the minimum width with .cxMin. The Autosize method that's there now just does a single scale operation on a single column when called. They're both useful for sure, just different.
http://i.imgur.com/NXFpqdV.jpg
In this pic, columns 1, 2, and 4 have been resized as small as they're now allowed with the auto-set width. Column 1 has a checkbox and a splitbutton, column 2 just a split button, and column 4 only text. No additional resizing code needed.
http://i.imgur.com/FU4BC7S.jpg
Here the ListView has been resized, and columns 3 and 5 have both been automatically scaled down, no other code involved.
The .cxMin allows setting a min width larger than LVS_EX_AUTOSIZECOLUMNS allows alone.
Hi, Krool. How can I get the VBCCR13.OCX? I am newly registered here in the forum and can't send PMs.
Update released.
As the ResizableColumnHeaders property does not need anymore comctls32.dll version 6.1 or higher to work it is only consistent that also the Resizable property of a ColumnHeader will work when the comctls32.dll version is below 6.1.
The bugfix in the ResizableColumnHeaders was in the 'Get' function.
It returned always True in case the property is not supported. (not supporting = resizable)
But now as the support barrier is gone it must return of course the actual property value.
I sent you a pm.
Hi Krool.
Change .Value option on OptionButtonW (also CheckboxW) does not generate a click event.
It is right?
Update released.
In this update the mouse events were improved. It concerns the button and shift states for the various mouse events, such as MouseMove.
Before this update the states were retrieved using GetAsyncKeyState.
Now the states are retrieved using the wParam value of the message. (except the ALT shift state, this is retrieved using GetKeyState, not GetAsyncKeyState)
This change might be also a minor performance boost as less API calls are now involved.
However, the main improvement is that the correct button value is now passed in case the left and right mouse button are "swapped" in the windows settings.
How do we download the files? I saw something about PM'ing you but I can click your profile and it does not give a way to PM you.
Also will these fix the problem of trying to use common dialog control in windows 7 in the VB6 IDE... gives a message that I don't have proper licensing to use the control (which makes no sense).
i.e. switch to your replacements and avoid all of the common dialog issues
Important update released.
As of this update all key and mouse events are now improved. I recommend to replace all components..
In fact now in all message handlers is now the GetKeyState API used.
(-> GetShiftStateFromParam/GetMouseStateFromParam and GetShiftStateFromMsg/GetMouseStateFromMsg functions)
GetAsyncKeyState is therefore not used anymore.
(-> GetShiftState/GetMouseState function)
The improvement is now that always the "buffered" shift and button state is passed into the events and not the "current" state anymore.
This can be important when the application is unresponsive for some time.
Another important improvement is the "correct" mouse button state when the left and right mouse buttons are swapped in the system settings.
GetKeyState returns always the state of the logical mouse button, whereas GetAsyncKeyState returns the state of the physical mouse button.
Therefore the SM_SWAPBUTTON mapping is only done in the GetShiftState/GetMouseState (GetAsyncKeyState) function and not in the others, for info.
Sorry for the inconvenience caused and the "wrong" handling in the past.
Krool, I've said it before but it's worth repeating. This is truly a phenomenal effort, and I'm continually impressed with your willingness to listen to suggestions for improvements.
Someday, I should attempt to follow your lead and include the MSFLXGRD.OCX and TABCTL32.OCX in this endeavor. The FiexGrid might be a bit of work, as it has some rather complex features. However, the TabControl is nothing but a fancy container that just shifts the controls off to the left when you click the different tabs. Knowing what I know about it, I could probably mock one up pretty quickly using the TabStrip and PictureBox, which you've already done.
Hi Elroy , you have received my private message
Problems sending it will not let me send them, it does not appear to me as sent.
Sorry for disturbing this post
a greeting
A FlexGrid replacement is already in process as said earlier. But will take some time as the first shot should be a complete replacement and quite stable.
However, that control will fit into this architecture (so the folder can included along the other controls) but will be separated from this here. As the FlexGrid is no "common control" and quite complex.
hi, Krool
I want a copy of the newest version of the VBCCR13.OCX , it is best to bring the source code , thx
you can send me by address : 198838369(please replace with @)163.com
Best Regards
Hi, Krool!
My project Crashes when the program exits from the event Form_KeyDown (Unload Me)
Crashes in IDE and exe-compiled.
If the exit from the program by pressing the cross, all ok.
My project is large, and are also used by other components using subsclassing, but error generate this function
Check please, when will be the timeCode:Public Property Let SubclassEntry(ByVal Entry As Long, ByVal Value As Boolean)
Entry = Entry - 1
Dim EntryPointer As Long
Debug.Assert Entry >= 0 And Entry <= PropVTableCount And VTableHeaderPointer <> 0
If Me.SubclassEntry(Entry + 1) Xor Value Then
EntryPointer = UnsignedAdd(VTableHeaderPointer, Entry * 4)
If Value = True Then
Call CreateSubclass(EntryPointer, vTable(Entry), VTableOld(Entry))
Else
Call CreateSubclass(EntryPointer, VTableOld(Entry), 0)
VTableOld(Entry) = 0
End If
End If
End Property
P.S. https://github.com/ADIAProject/DIA
I cannot replicate this crash in the Demo. Would be too easy of course if it also crashes there on Form_KeyDown. ;-)
I did not check your project, maybe you can try to narrow down the cause more on your own. For instance removing some of your other subclasses and so on.
Also it would be a try worth to use the OCX and see what happens there.
Hi Krool.
Small bug in OptionButtonW
If set .value=true for OptionButtonW, when close form and reopen i see that in Gui .value=false (no dot), in options .value=true
Attachment 143731
hello Krool, how can I get an "OCX" version of CommonControls (Replacement of the MS common controls) ?
@Krool
I want to use this ocx but before using i have 2 questions:
1) is this ocx completely free? should we buy it? (because i saw a screen shot with a title bar that there was a demo text in it)
2) did you write it yourself? or copied from another company website to this thread?
Thank you
Its free, nothing to buy. Where did you see the screen shot with demo text? You mean the demo project at first page? This is in fact the Std-EXE version and the leading version and the OCX derived from this from time to time. (Half or full year)
It's written by myself. Though I got inspired by vbaccelerator, which is also open source free.
Krool your ocx was so useful but there is a problem in ListBoxW
It doesn't support text align
Persian and Arabic languages need this property
Could you add these properties:
TextAlign
TextDirection
If a text starts with a number:
for example: 2 کرول
at this time (TextAlign=Right) can't help but (TextAlign=Right) + (TextDirection=RTL) can help very much
TNX :) :wave:
Update released.
Quite important bugfix for ListBoxW control. When the control has no items (empty) the .NewIndex property returned 0 instead of -1.
The ComboBoxW control was not affected, it already returned correctly -1 in this case.
Also enhanced the ListBoxW control when using it as an OLE drop target.
Included the InsertMark/InsertMarkColor property and HitTestInsertMark function.
The InsertMark property and the HitTestInsertMark function have both an optional 'After' parameter.
The demo project has been extended so that the ListBoxW control accepts OLE drop, showing the InsertMark functionality.
Attachment 143919
If there is a print preview of the good, such as support for DataGrid, mshflexgrid.
Yes, as chosk pointed out, the RightToLeft property is not available in the OCX yet. (only Std-EXE)
When you run the Demo project in the first page, that is a Std-EXE project. And there is also the Std-EXE ListBoxW used.
Just include the necessary components into your project. You actually don't need the whole OCX if you are just looking to implement a Unicode ListBox..
what is a print preview of the good? There is only a PageSetup and a Print dialog in CommonDialog.cls, no print preview..
@Krool: your useful ActiveX resolved another problem:
http://www.vbforums.com/showthread.p...in-RichTextBox
Thank you again :) :wave:
The following example not working:
The following example worked fine:Code:
RichTextBox1.RightToLeft = True
RichTextBox1.Text = "Krool"
!!!! :confused:Code:
RichTextBox1.RightToLeft = True
RichTextBox1.Text = "Krool"
RichTextBox1.Text = RichTextBox1.Text & ""
Update released.
The standard windows list box control has a 16-bit barrier when dragging the scroll box. (SB_THUMBPOSITION and SB_THUMBTRACK)
That limitation could be circumvented in the ListBoxW control by intercepting WM_HSCROLL/WM_VSCROLL and using the 32-bit GetScrollInfo function.
Also included the ScrollTrack property which controls if SB_THUMBTRACK will set the new position. (If set to False only SB_THUMBPOSITION has an effect)
Setting ScrollTrack to False could be an performance boost when using some code in the Scroll event.
@ Mahdi Jazini,
changing the RightToLeft in the RichTextBox control at run-time can be strange as the TextRTF itself does hold some rtl information.
The safest way to change it at run-time is to do following:
Code:RichTextBox1.TextMode = RtfTextModePlainText
RichTextBox1.RightToLeft = True
RichTextBox1.TextMode = RtfTextModeRichText
Hi Krool,
Any chance of an earlier release of the OCX with the LabelW VerticalAlignment property?
Update released.
the 32-bit thumb scrolling support works now properly in each "scenario" in the ListBoxW control.
Means vertical scolling is always 32-bit.
Horizontal scrolling is only 32-bit when also the MultiColumn property is set to True.
Else it remains 16-bit, which is the case for 'HorizontalExtent' scrolling. And that should certainly be sufficient. ;)
Sorry for the confusion..
I also think it gets time to bring out the next OCX release.
But as the forum rules are restricted about closed binaries I am thinking of publishing the source code along the binary.
This way I could upload everything in "UtilityBank - Components" and make a link from here to there.
What you guys think?
Hi Krool,
I wold love a new OCX version with the updates. I wold also like to know if the Palettes for selecting colors in the new .OCX would now work.
Thanks for the great work!