-
Re: CommonControls (Replacement of the MS common controls)
no need to change or add anything, i found a easy solution for the H-Scrollbar problem:
after the code:
Quote:
vlbLog.ListCount = GetLineCountFromTextArray
i use this command now:
and voila the h-scrollbar appears!
...or maybe you should do this refresh automatically inside the .ListCount property to fix the scrollbar display problem?
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
Schmidt
Whilst not an answer, how to fix the ".SelColor"-Problem... I'd say,
that a RichTextBox is not the ideal Control for a "Log-Viewer-for-large-Files".
Any virtual Grid or List-Control (heck, even a simple PictureBox) can solve the problem of:
loading, visualizing (and scrolling through) a 100MB-log with a first-load-reaction-time between 0.2-0.8 seconds
That time mostly determined by, how fast you can load that file from SSD or Disk into a ByteArray.
Olaf
Thanks a TON, olaf.
I had always thought that I should try loading large text files in Krool's VBFlexGrid and try but never got time for the same, as other things got up in the priority list. So, is it possible Olaf, with VBFlexGrid too?
I have not tried your VListBox code yet. I just thought of thanking you first, promptly, after reading your solution using VListBox. Will try it soon. Thanks again.
Kind Regards.
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
Mith
I still working on the basic functions.
I have completely rewritten your code to optimize everything for Unicode.
For example, i load the file content via CreateFileWide/ReadFile to support file/dirs with unicode characters in the name.
I also added a algo to determine different file encodings:
UTF8, UTF8NoBOM, UTF16LE, UTF16LEnoBOM, UTF16BE, UTF16BEnoBOM, ANSI
I also replaced the ANSI function "TextWidth" at event "VListBox1_GetVirtualItem" with API "GetTextExtentPoint32W" to get the correct text width.
With the ANSI function the scrollbar width was mostly wrong. ... .. .
...
..
.
Dear Mith,
Thanks a lot. Interested in your rewritten code, if you can share it, please.
Esp. interested in your algo which can correctly determine "UTF8 with no BOM" too.
Kind Regards.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
softv
Dear Krool,
If and when your time permits, kindly please let me know whether any solution exists for the issue above I have observed (I have provided the steps to produce it too).
The issue again, in a gist, is:
The selected item in a VirtualCombo changes to some other item upon DropDown of the list again. Not only that. The first two characters in the new(but wrong) item gets displayed in the typing area, in highlighted state. This issue happens when the style of the virtual combo is set to 0 (vbcStyleDropDownCombo).
Thanks and Kind regards.
I am still very much looking forward for a solution for this from you, Krool. Would be much thankful to you if you can provide the same. Thanks in advance.
Kind regards.
-
Re: CommonControls (Replacement of the MS common controls)
I just updated the documentation and compile/update utility which now handles VBFLXGRDxx.OCX files up through the just-released v1.5 and VBCCRxx.OCX up through the current v1.7. It is located at the bottom of post #1 in this thread.
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
softv
Esp. interested in your algo which can correctly determine "UTF8 with no BOM" too.
how-to-detect-utf-8-based-encoded-strings/
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
Mith
thank you so much.
kind regards.
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
softv
thank you so much.
kind regards.
Read this too: VB6-The-case-for-UTF-8
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
softv
I had always thought that I should try loading large text files in Krool's VBFlexGrid and try but never got time for the same, as other things got up in the priority list. So, is it possible Olaf, with VBFlexGrid too?
Sure... relatively easy to do via the IVBFlexDataSource interface, when you implement it in a little Class like the one below.
Into a Class, named cTextDataSource:
Code:
Option Explicit
Implements IVBFlexDataSource
Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal codePage As Long, ByVal dwFlags As Long, ByVal lpMultiByteStr As Long, ByVal cchMultiByte As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long
Private UTF8() As Byte, Offsets() As Long, LineCount As Long, LastLineIdx As Long, Line As String
Public Sub BindToTextFile(FG As VBFlexGrid, FileName As String)
UTF8 = ReadFileBytes(FileName)
LineCount = GetLines(UTF8, Offsets)
LastLineIdx = -1
Set FG.FlexDataSource = Me 'bind this Class (and set a few FG-defaults)
FG.ColWidth(0) = 1800
FG.ExtendLastCol = True
FG.ScrollTrack = True
End Sub
Private Function ReadFileBytes(FileName As String) As Byte()
Dim FNr As Long: FNr = FreeFile
On Error GoTo 1
Open FileName For Binary As FNr
ReDim ReadFileBytes(LOF(FNr) - 1)
Get FNr, , ReadFileBytes
1 If Err Then ReadFileBytes = StrConv(Err.Description, vbFromUnicode)
Close FNr
End Function
Private Function GetLines(UTF8() As Byte, Offsets() As Long) As Long
Dim OffsUB As Long: OffsUB = 1024: ReDim Offsets(OffsUB)
Dim i As Long, j As Long, LF As Byte
For i = 0 To UBound(UTF8)
If UTF8(i) = 13 Or UTF8(i) = 10 Then LF = UTF8(i): Exit For
Next
For i = 0 To UBound(UTF8)
If UTF8(i) = LF Then
If j >= OffsUB Then OffsUB = 1.5 * OffsUB: ReDim Preserve Offsets(OffsUB)
j = j + 1: Offsets(j) = i
End If
Next
If UTF8(i - 1) <> 13 And UTF8(i - 1) <> 10 Then
If j >= OffsUB Then OffsUB = 1.5 * OffsUB: ReDim Preserve Offsets(OffsUB)
j = j + 1: Offsets(j) = i
End If
GetLines = j
End Function
Private Function GetLine(ByVal ZeroBasedLineIdx As Long) As String
Dim Offs As Long: Offs = Offsets(ZeroBasedLineIdx)
If UTF8(Offs) = 13 Then Offs = Offs + 1
If UTF8(Offs) = 10 Then Offs = Offs + 1
Dim BLen As Long: BLen = Offsets(ZeroBasedLineIdx + 1) - Offs
If BLen > 0 Then 'UTF8-to-BSTR conversion, directly from the UTF8-bytearray
GetLine = Space$(MultiByteToWideChar(65001, 0, VarPtr(UTF8(Offs)), BLen, 0, 0))
MultiByteToWideChar 65001, 0, VarPtr(UTF8(Offs)), BLen, StrPtr(GetLine), Len(GetLine)
End If
End Function
'***** Implementation of IVBFlexDataSource *****
Private Function IVBFlexDataSource_GetRecordCount() As Long
IVBFlexDataSource_GetRecordCount = LineCount
End Function
Private Function IVBFlexDataSource_GetFieldCount() As Long
IVBFlexDataSource_GetFieldCount = 2
End Function
Private Function IVBFlexDataSource_GetFieldName(ByVal Field As Long) As String
Select Case Field
Case 0: IVBFlexDataSource_GetFieldName = "TimeStamp"
Case 1: IVBFlexDataSource_GetFieldName = "LogInfo"
End Select
End Function
Private Function IVBFlexDataSource_GetData(ByVal Field As Long, ByVal Record As Long) As String
If LastLineIdx <> Record Then
LastLineIdx = Record
Line = GetLine(Record)
End If
Select Case Field
Case 0: IVBFlexDataSource_GetData = Left$(Line, 19)
Case 1: IVBFlexDataSource_GetData = Mid$(Line, 21)
End Select
End Function
Private Sub IVBFlexDataSource_SetData(ByVal Field As Long, ByVal Record As Long, ByVal NewData As String)
End Sub
And this into a Form for testing with one of your own Log- or TextFiles:
(the Form needs an instance of VBFlexgrid1, ... either in version 1.4. or in newest version 1.5)
Code:
Option Explicit
Const FileName = "c:\temp\test3.txt"
Private FlexDS As New cTextDataSource
Private Sub Form_Load()
VBFlexGrid1.Font.Name = "Arial"
FlexDS.BindToTextFile VBFlexGrid1, FileName
End Sub
Private Sub Form_Resize()
VBFlexGrid1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
Since the FlexGrid is normally used for "Multi-Column-Data",
I've artificially created a LogFile with a leading (ISO) Timestamp per Line, to have more than one Column "to split" for the FG.
Used the RC6 for that, with the following snippet:
Code:
With New_c.StringBuilder
Dim i As Long, D As Double: D = Now
For i = 1 To 100000
D = D + 1 / 86400
.Add Format$(D, "yyyy\-mm\-dd hh\:nn\:ss")
.AddNL " Some loooooooooooooooooonger Log-Entry-Line " & i
Next
New_c.FSO.WriteByteContent FileName, .ToUTF8
End With
HTH
Olaf
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
Schmidt
Sure... relatively easy to do via the IVBFlexDataSource interface, when you implement it in a little Class like the one below.
Into a Class, named
cTextDataSource:
Code:
Option Explicit
Implements IVBFlexDataSource
Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal codePage As Long, ByVal dwFlags As Long, ByVal lpMultiByteStr As Long, ByVal cchMultiByte As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long
Private UTF8() As Byte, Offsets() As Long, LineCount As Long, LastLineIdx As Long, Line As String
Public Sub BindToTextFile(FG As VBFlexGrid, FileName As String)
UTF8 = ReadFileBytes(FileName)
LineCount = GetLines(UTF8, Offsets)
LastLineIdx = -1
Set FG.FlexDataSource = Me 'bind this Class (and set a few FG-defaults)
FG.ColWidth(0) = 1800
FG.ExtendLastCol = True
FG.ScrollTrack = True
End Sub
Private Function ReadFileBytes(FileName As String) As Byte()
Dim FNr As Long: FNr = FreeFile
On Error GoTo 1
Open FileName For Binary As FNr
ReDim ReadFileBytes(LOF(FNr) - 1)
Get FNr, , ReadFileBytes
1 If Err Then ReadFileBytes = StrConv(Err.Description, vbFromUnicode)
Close FNr
End Function
Private Function GetLines(UTF8() As Byte, Offsets() As Long) As Long
Dim OffsUB As Long: OffsUB = 1024: ReDim Offsets(OffsUB)
Dim i As Long, j As Long, LF As Byte
For i = 0 To UBound(UTF8)
If UTF8(i) = 13 Or UTF8(i) = 10 Then LF = UTF8(i): Exit For
Next
For i = 0 To UBound(UTF8)
If UTF8(i) = LF Then
If j >= OffsUB Then OffsUB = 1.5 * OffsUB: ReDim Preserve Offsets(OffsUB)
j = j + 1: Offsets(j) = i
End If
Next
If UTF8(i - 1) <> 13 And UTF8(i - 1) <> 10 Then
If j >= OffsUB Then OffsUB = 1.5 * OffsUB: ReDim Preserve Offsets(OffsUB)
j = j + 1: Offsets(j) = i
End If
GetLines = j
End Function
Private Function GetLine(ByVal ZeroBasedLineIdx As Long) As String
Dim Offs As Long: Offs = Offsets(ZeroBasedLineIdx)
If UTF8(Offs) = 13 Then Offs = Offs + 1
If UTF8(Offs) = 10 Then Offs = Offs + 1
Dim BLen As Long: BLen = Offsets(ZeroBasedLineIdx + 1) - Offs
If BLen > 0 Then 'UTF8-to-BSTR conversion, directly from the UTF8-bytearray
GetLine = Space$(MultiByteToWideChar(65001, 0, VarPtr(UTF8(Offs)), BLen, 0, 0))
MultiByteToWideChar 65001, 0, VarPtr(UTF8(Offs)), BLen, StrPtr(GetLine), Len(GetLine)
End If
End Function
'***** Implementation of IVBFlexDataSource *****
Private Function IVBFlexDataSource_GetRecordCount() As Long
IVBFlexDataSource_GetRecordCount = LineCount
End Function
Private Function IVBFlexDataSource_GetFieldCount() As Long
IVBFlexDataSource_GetFieldCount = 2
End Function
Private Function IVBFlexDataSource_GetFieldName(ByVal Field As Long) As String
Select Case Field
Case 0: IVBFlexDataSource_GetFieldName = "TimeStamp"
Case 1: IVBFlexDataSource_GetFieldName = "LogInfo"
End Select
End Function
Private Function IVBFlexDataSource_GetData(ByVal Field As Long, ByVal Record As Long) As String
If LastLineIdx <> Record Then
LastLineIdx = Record
Line = GetLine(Record)
End If
Select Case Field
Case 0: IVBFlexDataSource_GetData = Left$(Line, 19)
Case 1: IVBFlexDataSource_GetData = Mid$(Line, 21)
End Select
End Function
Private Sub IVBFlexDataSource_SetData(ByVal Field As Long, ByVal Record As Long, ByVal NewData As String)
End Sub
And this into a Form for testing with one of your own Log- or TextFiles:
(the Form needs an instance of VBFlexgrid1, ... either in version 1.4. or in newest version 1.5)
Code:
Option Explicit
Const FileName = "c:\temp\test3.txt"
Private FlexDS As New cTextDataSource
Private Sub Form_Load()
VBFlexGrid1.Font.Name = "Arial"
FlexDS.BindToTextFile VBFlexGrid1, FileName
End Sub
Private Sub Form_Resize()
VBFlexGrid1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
Since the FlexGrid is normally used for "Multi-Column-Data",
I've artificially created a LogFile with a leading (ISO) Timestamp per Line, to have more than one Column "to split" for the FG.
Used the RC6 for that, with the following snippet:
Code:
With New_c.StringBuilder
Dim i As Long, D As Double: D = Now
For i = 1 To 100000
D = D + 1 / 86400
.Add Format$(D, "yyyy\-mm\-dd hh\:nn\:ss")
.AddNL " Some loooooooooooooooooonger Log-Entry-Line " & i
Next
New_c.FSO.WriteByteContent FileName, .ToUTF8
End With
HTH
Olaf
Only just a moment ago, I posted a query in Krool's 'VBFlexGrid Control' thread about whether we can bind a VBFlexGrid to a database table (for a different purpose though). In fact, it so happened that I mentioned about you too in that post! :)
And, after posting it, I came here (to the 'Common Controls' thread) almost immediately to check for any new posts and I find yours on how to load large text files in the VBFlexGrid!!!!! What a coincidence and what a joy! Thanks a TON, Olaf. Will try it out soon in the recently released 1.5 Ocx.
In case large RichText (with all formatting - B/I/U/etc. - intact) has to be loaded and shown, then which control of Krool's will be ideal? (since VBFlexGrid or ListBox cannot show Rich Text, if I am right). Or, using PictureBox only will be the ideal one? If so, what would be the code as a startup for the same? Kindly please show me the way, since showing large RichText content also will be the case for me.
Kind regards.
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
softv
In case large RichText (with all formatting - B/I/U/etc. - intact) has to be loaded and shown,
then which control of Krool's will be ideal?
Ermm, the RichTextBox-Control? ;)
The RichTextBox-Ctl is not the right Control for "huge PlainText-Files" ...
whereas for *.rtf-files which contain extensive formatting - it simply is.
Olaf
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
I use this function to detect UTF8 without BOM. Just get a max of 1000 bytes from file (if less get all bytes from file)
Code:
Public Function ContainsUTF8(ByRef Source() As Byte) As Boolean
Dim i As Long, lUBound As Long, lUBound2 As Long, lUBound3 As Long
Dim CurByte As Byte
lUBound = UBound(Source)
lUBound2 = lUBound - 2
lUBound3 = lUBound - 3
If lUBound > 2 Then
For i = 0 To lUBound - 1
CurByte = Source(i)
If (CurByte And &HE0) = &HC0 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
Else
ContainsUTF8 = False
Exit For
End If
ElseIf (CurByte And &HF0) = &HE0 Then
' 2 bytes
If (Source(i + 1) And &HC0) = &H80 Then
i = i + 1
If i < lUBound2 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
ElseIf (CurByte And &HF8) = &HF0 Then
' 2 bytes
If (Source(i + 1) And &HC0) = &H80 Then
i = i + 1
If i < lUBound2 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
If i < lUBound3 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
End If
Next i
End If
End Function
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
This if for UTF16, if return 1 then missing BOM is &HFEFF (LE), for 2 the missing BOM is &HFFFE (BE - BOM reading from BE is &HFEFF), else no UTF16 found.
Code:
Public Function ContainsUTF16(ByRef Source() As Byte) As Long
Dim i As Long, lUBound As Long, lUBound2 As Long, lUBound3 As Long
Dim CurByte As Byte, CurByte1 As Byte
Dim CurBytes As Long, CurBytes1 As Long
lUBound = UBound(Source)
If lUBound > 4 Then
CurByte = Source(0)
CurByte1 = Source(1)
For i = 2 To lUBound - 1 Step 2
If CurByte1 = 0 And CurByte < 31 Then CurBytes1 = CurBytes1 + 1
If CurByte = 0 And CurByte1 < 31 Then CurBytes = CurBytes + 1
If Source(i) = CurByte Then
CurBytes = CurBytes + 1
Else
CurByte = Source(i)
End If
If Source(i + 1) = CurByte1 Then
CurBytes1 = CurBytes1 + 1
Else
CurByte1 = Source(i + 1)
End If
Next i
End If
If CurBytes1 = CurBytes And CurBytes1 * 3 >= lUBound Then
ContainsUTF16 = 0
Else
If CurBytes1 * 3 >= lUBound Then
ContainsUTF16 = 1
ElseIf CurBytes * 3 >= lUBound Then
ContainsUTF16 = 2
Else
ContainsUTF16 = 0
End If
End If
End Function
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
Schmidt
Ermm, the RichTextBox-Control? ;)
The RichTextBox-Ctl is not the right Control for "huge PlainText-Files" ...
whereas for *.rtf-files which contain extensive formatting - it simply is.
Olaf
:) :)
you are right of course and I do use Krool's RichTextBox control only to show richtext. But then, the RichTextBox control takes (I am sure any RichTextBox control (rtb, for short) for that matter, not just Krool's) quite some time to load large .rtf files (for instance, it takes 5 seconds to load a 7.5MB rtf file in my system [with 16gb ram]). When the need is just to show the lengthy content of a .rtf file in the rtb and not anything much to do with the rtb's contents thereafter, I thought it will be great if the RichText content can load lightning fast (both from a large file and also by setting it a lengthy/long string), much similar to the plain text content (which you have written takes just 60millisec for LineParsing + first visualization, with your super code).
So, the above fast loading (as in the case of a plain text) cannot be achieved for RichText too by some/any means? That was my point of interest. If you can do that, olaf (just like you did it for plain text), nothing like it. If that cannot be done, then, is buffered loading of contents possible (as the user scrolls the rtb)? If so, will it be as seamless/same as viewing/scrolling a RichTextBox with all contents loaded fully? If so, possible for you to provide a solution for the same?
Actually, after reading your message, I thought I will re-visit that module of mine which gave me problems with RichTextBox 3 years back. The problem occurred in a specific case (of a long string) only, which took a long time to load and still further time to execute a ".SelFontCharset" on the whole text. Many a times it used to hang. I could not solve this specific case at all, after trying a lot. Finally, I just gave it up.
And, what a blessing it turned out to be, to revisit that module of mine again! Because, I could fix the problem yesterday after lots and lots of experiments. I felt overjoyed. And, all thanks to you!!! Because, but for your message, perhaps I would not have visited that module again. Well, for a problem of this kind, a veteran like you would have fixed it in a jiffy, I am sure. But, for a person like me, I needed to work it out the hard way. :)
On what I did to fix my problem, I will post as a reply to Mith's message so that perhaps it can help solve his problem too (regarding '.SelColor').
Always remaining in gratitude to yours and Krool's invaluable contributions to this world society.
Kind regards.
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
Mith
VBCCR 1.7.35
Hi krool,
i use the follwing code to set the background color to black and the text color to white before i load a text file into the RichtextBox:
Code:
rtf1.TextMode = RtfTextModeRichText
rtf1.Text = "Please wait..."
rtf1.BackColor = vbBlack
rtf1.SelStart = 0
rtf1.SelLength = Len(rtf1.Text)
rtf1.SelColor = vbWhite
rtf1.LoadFile sLogFile, RtfLoadSaveFormatUnicodeText
The code works fine using Windows 7 and the loaded text will have the correct text color: a black background with white text.
The problem comes with Windows 8/10/11: the text color of the loaded text is not white anymore; it's still black (the standard color); and now i have black text on a black background!
My questions:
1. Do you have any idea why the RichtextBox behaves different when loading a file using Win8/10/11?
2. Does anyone know a solution for Win8/10/11 to set the text color BEFORE loading a text file?
greetings Mith
PS: I already know that i can change the text color after i loaded the logfile, but this is practically impossible because it takes forever (the app hangs) to change the selected color with ".SelColor" when loading large text files (1/10/50/100mb...).
Ref post: post #3314 (my reply message to Olaf)
The problem I have referred to in my abovementioned post was to do with setting a long string to a RichTextBox (rtb, for short) and thereafter immediately selecting it fully and setting its '.SelFontCharset' and '.SelFontName'.
It was taking nearly 1 minute (to sometimes even 1.5 minutes) in Windows7 (with 4gb ram), for the above process to complete. That was 3 years back. Now I have a Windows 10 system (with 16gb ram). In it, it was taking 25 seconds for the above process to complete. But, even that, it would mostly work only the first time the process took place. Other times, more often than not, it would hang, both in IDE and as an executable.
So, after lots of experiments yesterday (which continued today also), what worked finally to bring down the processing time to 5 seconds is, the following:
--
1. Setting the width and height of the rtb to 0 before starting the process (in addition to rtb.visible = false)
2. Once the process is over, setting back the height and width of the rtb to whatever it was earlier.
3. Doing the above was a real boon. Because, '.SelFontCharset' happened instantly, which was the one which used to hog the longest time in the whole process, without the above fix.
4. Now, after the above fix, the one which takes the major chunk (4 seconds) of the 5 seconds is '.SelLength'. Setting the long string (lstr, for short) to the rtb takes 1 second. '.SelLength' also happens within a second, if ScrollBars property is set to 'vbBoth' but then I need my ScrollBars to be vbVertical only. So, I could not take advantage of that.
5. Actually, I do set the font of the rtb to the same '.SelFontName' (Arial Unicode MS) at the very start itself but that does not display all the Unicode characters of lstr correctly. After setting 'rtb.text = lstr', I have to necessarily select the whole text of the rtb and set '.SelFontCharset' to 0 and '.SelFontName' to 'Arial Unicode MS' again. Then only all the characters will display correctly, as per their glyphs. Otherwise, some of the characters in some ranges would appear as boxes only. Why it happens so, I don't know. If krool can tell why and suggest a way by which the whole above process (all that processing I have to do after setting 'rtb.text = lstr') can be avoided, that would be great.
--
Note-1:
I did try out '.SelColor' too on my long text since you had difficulty with '.SelColor'. And, the result was the same, with my fix. It was instant. Otherwise (without my above fix), it was taking a considerable time (6 seconds in my system) to execute.
Note-2:
The lstr (long string) which I am referring to is 77K+ characters, half of which are spaces and the other half are multilingual characters. Basically, multilingual characters (from 'Arial Unicode MS') separated by spaces.
Note-3:
If you or somebody can come out with a way to reduce the time taken by 'rtb.text = lstr' and '.SelLength' too, that would be great. In effect, if somebody can provide a way to reduce the whole processing time itself, as such, to a millisecond, that would be great. Because, if it still takes 5 seconds in my 16gb system, I am sure the whole process would take more time in a 4gb system. Suppose it takes 30 seconds. Then, 30 seconds would be too long a time, I feel, to set an rtb with a string of 77k+ characters.
Note-4:
Yesterday I found out that introducing 'DoEvents', at some points in the above process, seemed to smoothen out the process a bit. But, today, I found out that 'rtb.Refresh' itself (in place of DoEvents) was enough to see that bit of smoothening in the process but then using 'rtb.Refresh' was causing some mild flashes in the screen. So, finally, I tried using 'rtb.ResetUndoQueue' before/after every .SelXyz setting and that looks promising for me. It is very smooth now.
I really do not know whether my fixes/findings above which worked out for me would work out for you too (in the case of your .SelColor), in a significant manner. If it does, I would be happy indeed. But, even otherwise, my fixes/findings above may be of help to somebody in this forum, now or in future, I believe. It may perhaps help krool too to come out with some enhancements (for instance, like the recent UseCrLf property) to the rtb control, in the future.
Kind regards.
-
Re: RichtextBox text color - different behavior since Windows 8/10/11
Quote:
Originally Posted by
georgekar
I use this function to detect UTF8 without BOM. Just get a max of 1000 bytes from file (if less get all bytes from file)
Code:
Public Function ContainsUTF8(ByRef Source() As Byte) As Boolean
Dim i As Long, lUBound As Long, lUBound2 As Long, lUBound3 As Long
Dim CurByte As Byte
lUBound = UBound(Source)
lUBound2 = lUBound - 2
lUBound3 = lUBound - 3
If lUBound > 2 Then
For i = 0 To lUBound - 1
CurByte = Source(i)
If (CurByte And &HE0) = &HC0 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
Else
ContainsUTF8 = False
Exit For
End If
ElseIf (CurByte And &HF0) = &HE0 Then
' 2 bytes
If (Source(i + 1) And &HC0) = &H80 Then
i = i + 1
If i < lUBound2 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
ElseIf (CurByte And &HF8) = &HF0 Then
' 2 bytes
If (Source(i + 1) And &HC0) = &H80 Then
i = i + 1
If i < lUBound2 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
If i < lUBound3 Then
If (Source(i + 1) And &HC0) = &H80 Then
ContainsUTF8 = True
i = i + 1
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
Else
ContainsUTF8 = False
Exit For
End If
End If
Next i
End If
End Function
Thank you ever so much, for both your codes. I think when I find time to walk through your codes, I will understand them precisely (as to how they effect their intended tasks).
Kind regards.
-
Re: CommonControls (Replacement of the MS common controls)
Hello Krool,
I added a ListBoxW with Style to CheckBox, but it seems that the items selected set by code have no effect:
Code:
ListBoxW1.AddItem "AAA"
ListBoxW1.Selected(ListBoxW1.NewIndex) = True
ListBoxW1.AddItem "BBB"
ListBoxW1.Selected(ListBoxW1.NewIndex) = True
ListBoxW1.AddItem "CCC"
Edit: I just found the new property ItemChecked. Anyway, it seems to be an issue for backward compatibility with the VB.ListBox.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Eduardo-
Hello Krool,
I added a ListBoxW with Style to CheckBox, but it seems that the items selected set by code have no effect:
Code:
ListBoxW1.AddItem "AAA"
ListBoxW1.Selected(ListBoxW1.NewIndex) = True
ListBoxW1.AddItem "BBB"
ListBoxW1.Selected(ListBoxW1.NewIndex) = True
ListBoxW1.AddItem "CCC"
Edit: I just found the new property
ItemChecked. Anyway, it seems to be an issue for backward compatibility with the VB.ListBox.
Yes it's a difference... The VB ListBox has no way to programmatically select items.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
krool
yes it's a difference... The vb listbox has no way to programmatically select items.
Ok, thanks.
-
Re: CommonControls (Replacement of the MS common controls)
Hi
My project has used VBCCR11.OCX successfully :-) for a long time. Now I thought I would upgrade to 17.
My DTPicker controls now no longer have the ShowCalendar method. Is this intentional? I have not found anything about it in this thread.
Am I supposed to be able to programmatically show it some other way?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
TomasEss
Hi
My project has used VBCCR11.OCX successfully :-) for a long time. Now I thought I would upgrade to 17.
My DTPicker controls now no longer have the ShowCalendar method. Is this intentional? I have not found anything about it in this thread.
Am I supposed to be able to programmatically show it some other way?
It must be replaced by the .DroppedDown property (get/let).
-
Re: CommonControls (Replacement of the MS common controls)
-
Re: CommonControls (Replacement of the MS common controls)
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Krool
please could you tell why labelws and CommandButtonWs are showing Arabic language like this:
Attachment 183606
thanks
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
samer22
please could you tell why labelws and CommandButtonWs are showing Arabic language like this:
I cant reproduce this problem here using Window 7 with VBCCR1.7:
Attachment 183611
All controls use the standard font "MS Sans Serif".
MAybe your problem has something to do with your windows unicode settings for non-unicode programs.
From my experience i can tell you that this windows setting can screw up the unicode display of vb apps.
-
Re: CommonControls (Replacement of the MS common controls)
thanks Mith for your interest
Could you try format "Arab Egypt " and location "Egypt" in regional settings.
I'm using Window 7 with VBCCR1.7 too
-
Re: CommonControls (Replacement of the MS common controls)
It's recommended to use the better Microsoft Sans Serif font instead of MS Sans Serif.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
It's recommended to use the better Microsoft Sans Serif font instead of MS Sans Serif.
thanks but still no luck
Same issue with VbFlexgrid
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
samer22
Could you try format "Arab Egypt " and location "Egypt" in regional settings.
I work with a german Windows version. You should try another format and location because i dont have any problems here :)
-
Re: CommonControls (Replacement of the MS common controls)
how does the CommandButtonW.ImageList work with Picture DisabledPicture and DownPicture?
do i need a separate ImageList for each CommandButtonW/Picture-type
also i noticed that the MaskColor/UseMaskColor don't work when using picture without ImageList
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Semke
how does the CommandButtonW.ImageList work with Picture DisabledPicture and DownPicture?
do i need a separate ImageList for each CommandButtonW/Picture-type
also i noticed that the MaskColor/UseMaskColor don't work when using picture without ImageList
MaskColor is only applicable for Style = 1 Graphical.
Same with DownPicture and DisabledPicture.
For Style = 0 Normal you can either use Picture or ImageList.
Code:
' The image list should contain either a single image to be used for all states or
' individual images for each state. The following states are defined as following:
' PBS_NORMAL = 1
' PBS_HOT = 2
' PBS_PRESSED = 3
' PBS_DISABLED = 4
' PBS_DEFAULTED = 5
' PBS_STYLUSHOT = 6
-
Re: CommonControls (Replacement of the MS common controls)
Hey Krool - I swear I saw somewhere a discussion on adding the ability for png files but I cant find it. Can you point me in the right direction?
Edited - I think I found it. It was a convo between you and Trick. I guess it still isn't supported.
-
Re: CommonControls (Replacement of the MS common controls)
Hello,
I'm using the VBCCR16.OCX and I want to upgrade to VBCCR17.OCX but the VisualStyles.bas of the VBCCR17 doesn't include the SetupVisualStyles function or the InitVisualStyles.
With the VBCCR16, I had on the top of each form "SetupVisualStyles(me)", isn't this necessary anymore?
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
PauloFranc
Hello,
I'm using the VBCCR16.OCX and I want to upgrade to VBCCR17.OCX but the VisualStyles.bas of the VBCCR17 doesn't include the SetupVisualStyles function or the InitVisualStyles.
With the VBCCR16, I had on the top of each form "SetupVisualStyles(me)", isn't this necessary anymore?
Thanks
You shall take VisualStyles.bas from the demo in post #1 of this thread.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
You shall take VisualStyles.bas from the demo in post #1 of this thread.
Thanks for the reply and thanks a lot for you work :)
-
Re: CommonControls (Replacement of the MS common controls)
Hello Krool, I'm using the latest compiled version of the ocx (VBCCR17.OCX), and I'm seeing some issues regarding the CheckBoxW:
1) I find no way to disable the focus rect.
I'm using Windows 11 with visual styles enabled (I guess Windows 10 must be the same) and the original VB CheckBox does not show the focus rect when visual styles are enabled.
2) The property "Custom" that is supposed to display the property pages seems to just change the Value property.
3) The property Transparent does not work at design time, but that is probably by design.
PS: I didn't go to check the control's source code.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Eduardo-
Hello Krool, I'm using the latest compiled version of the ocx (VBCCR17.OCX), and I'm seeing some issues regarding the CheckBoxW:
1) I find no way to disable the focus rect.
I'm using Windows 11 with visual styles enabled (I guess Windows 10 must be the same) and the original VB CheckBox does not show the focus rect when visual styles are enabled.
2) The property "Custom" that is supposed to display the property pages seems to just change the Value property.
3) The property Transparent does not work at design time, but that is probably by design.
PS: I didn't go to check the control's source code.
Hi Eduardo,
1) When an app is themed it has no focus rect but it will show focus rects once you use the tab key once on a window. However, this does not work in VB6. That's why the focus rect are forced in the CheckBoxW control via WM_UPDATEUISTATE. Also the VisualStyles.bas uses WM_UPDATEUISTATE on the SetupVisualStyles method for the whole form.
If you have another approach in mind please let me know or discuss it.
2) The Value property is the default property. The CheckBoxW has no property page, that's why the "Custom" is falling back to the Value property.
3) Yes that's ignored at design time. The property description also tells this.
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
Hi Eduardo,
1) When an app is themed it has no focus rect but it will show focus rects once you use the tab key once on a window. However, this does not work in VB6. That's why the focus rect are forced in the CheckBoxW control via WM_UPDATEUISTATE. Also the VisualStyles.bas uses WM_UPDATEUISTATE on the SetupVisualStyles method for the whole form.
If you have another approach in mind please let me know or discuss it.
I would have to study what you are saying.
I just wanted to put some CheckBoxes with no caption, and I got this:
Attachment 183855
For now I solved it by making the CheckBoxes narrower enough.
Quote:
Originally Posted by
Krool
2) The Value property is the default property. The CheckBoxW has no property page, that's why the "Custom" is falling back to the Value property.
When an UserControl has no property page, the "Custom" property does not appear at the property page.
I checked and the CheckBoxW has defined three property pages:
StandardFont
StandardColor
StandardPicture
The problem seems to be the call:
Code:
Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
At UserControl_Initialize.
I think one solution might be to call it at UserControl_InitProperties and UserControl_ReadProperties but only when Ambient.UserMode is False.
Quote:
Originally Posted by
Krool
3) Yes that's ignored at design time. The property description also tells this.
OK.
Thanks :thumb:
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Eduardo-
When an UserControl has no property page, the "Custom" property does not appear at the property page.
I checked and the CheckBoxW has defined three property pages:
StandardFont
StandardColor
StandardPicture
The problem seems to be the call:
Code:
Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
At UserControl_Initialize.
I think one solution might be to call it at UserControl_InitProperties and UserControl_ReadProperties but only when Ambient.UserMode is False.
I found out the reason. The (Custom) item raises IPerPropertyBrowsingVB::GetPredefinedStrings with an DispID of 0.
But since the Value property is the default property it also has a DispID of 0... (const DISPID_VALUE; 0)
So, it's unfortunate but I think it can be only fixed by using an Enum (As Long) instead of having the property As Integer currently.
But that would break VBCCR17 compatibility. So it's unlikely to be changed. And it's anyway just a minor glitch as there is no real property page behind anyway.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
I found out the reason. The (Custom) item raises IPerPropertyBrowsingVB::GetPredefinedStrings with an DispID of 0.
But since the Value property is the default property it also has a DispID of 0... (const DISPID_VALUE; 0)
So, it's unfortunate but I think it can be only fixed by using an Enum (As Long) instead of having the property As Integer currently.
But that would break VBCCR17 compatibility. So it's unlikely to be changed. And it's anyway just a minor glitch as there is no real property page behind anyway.
IDK what that call does, I mean Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
What is the purpose?
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Eduardo-
IDK what that call does, I mean Call SetVTableHandling(Me, VTableInterfacePerPropertyBrowsing)
What is the purpose?
For example to list all ImageLists available etc. in a property
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
For example to list all ImageLists available etc. in a property
Ah, OK. Then my suggestion of calling it only at runtime made no sense.
-
Re: CommonControls (Replacement of the MS common controls)
Does anyone know how to set listview ColumnHeaders width?
Code:
ListView1.ColumnHeaders(1).Width = 200
this code is throwing error
-
Re: CommonControls (Replacement of the MS common controls)
What's the error number & message?
-
Re: CommonControls (Replacement of the MS common controls)
I tried this and it worked as expected without error:
Code:
Option Explicit
Private Sub Form_Click()
Me.ListView1.ColumnHeaders(1).Width = 10000
End Sub
Private Sub Form_Load()
Me.ListView1.ColumnHeaders.Add , , "A"
Me.ListView1.ColumnHeaders.Add , , "B"
Me.ListView1.ColumnHeaders.Add , , "C"
Me.ListView1.View = LvwViewReport
End Sub
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
jpbro
What's the error number & message?
incorrect argument
Are you using Krool's listview?
Anyway i figured out how to do that
Code:
ListView1.ColumnHeaders.Add , , "Name", 2000, LvwColumnHeaderAlignmentLeft
ListView1.ColumnHeaders.Add , , "Symbol", 1200, LvwColumnHeaderAlignmentCenter
thank you
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mustaphi
Are you using Krool's listview?
Yes, I tried it with v1.7 of the OCX version of Krool's controls and there was no problem. Maybe you are using a different version?
-
Re: CommonControls (Replacement of the MS common controls)
Hi,
I have the sub main call the main form of the application, an MDI frm, but it doesn't even show the form giving "Run-time error 440: Automation error"
My problem is that this only happens on some PCs, one of them has Windows 7 and I found out that reducing the colour depth it stopped giving this problem. But I am now trying to run it on a Windows Server 2003 and can't get it to work.
Does anyone have any ideas about what can be happening?
Thanks
-
Re: CommonControls (Replacement of the MS common controls)
Found it... I have a toolbar linked to imagelists with the icons I need. The last two icons had a colour depth bigger than the others and older PCs couldn't cope with that.
Since the automation error was being shown in a window with VBCCR17 in the title, I never thought that could be the problem.
-
Re: CommonControls (Replacement of the MS common controls)
Hello Krool, thanks making and maintaining these controls! I have two questions/issues; apologies if these have been covered.
ComboBoxW - is there a reason that the Text property isn't the default?
MonthView - the latest version is better than the 1.5 version I was using previously, but when setting VisualStyles = False, the runtime size is still not quite the same size as the design-time size. Testing at normal DPI, font = Arial Regular 10.
Thanks!
Dan
-
Re: CommonControls (Replacement of the MS common controls)
One more:
MonthView - DateDblClick
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
hausman
ComboBoxW - is there a reason that the Text property isn't the default?
MonthView - the latest version is better than the 1.5 version I was using previously, but when setting VisualStyles = False, the runtime size is still not quite the same size as the design-time size. Testing at normal DPI, font = Arial Regular 10.
ComboBoxW - That's a bug! The VB.ComboBox has a hidden [_Default] property that redirects to the Text property. The VB.Label has the same logic and the LabelW control considered that but unfortunately not for the ComboBox...
Will look to fix that, hopefully possible for VBCCR17 without breaking.
MonthView - maybe the IDE is not manifest and links to comctl. 5.8x and the compiled executable has a manifest and is linked to comctl. 6.x. (even if both are not themed [VisualStyles = False] the controls are different)
What you mean with DateDblClick ? Please more context on that one.
-
Re: CommonControls (Replacement of the MS common controls)
Update released.
Included the GetTextRange function in the RichTextBox control.
Included [_Default] property in ComboBoxW/FontCombo/VirtualCombo/ImageCombo.
The MS ImageCombo doesn't have a default property, but I think it is of no harm to make the .Text property as the default member there as well.
The OCX VBCCR17 was also updated. The internal type lib version is now 1.2.
Code:
Object={7020C36F-09FC-41FE-B822-CDE6FBB321EB}#1.2#0; VBCCR17.OCX
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Krool
ComboBoxW - That's a bug! The VB.ComboBox has a hidden [_Default] property that redirects to the Text property. The VB.Label has the same logic and the LabelW control considered that but unfortunately not for the ComboBox...
Will look to fix that, hopefully possible for VBCCR17 without breaking.
FYI, I had changed the Attribute Text.VB_UserMemId = 0 to accomplish this. Not sure which method is best.
Quote:
Originally Posted by
Krool
MonthView - maybe the IDE is not manifest and links to comctl. 5.8x and the compiled executable has a manifest and is linked to comctl. 6.x. (even if both are not themed [VisualStyles = False] the controls are different)
Sorry, yes, you are correct. The EXE is running with a manifest, while the IDE is not. I think I remember seeing an article about putting a manifest on the IDE EXE... I'll look into that.
Quote:
Originally Posted by
Krool
What you mean with DateDblClick ? Please more context on that one.
DateDblClick is an event in the stock MonthView control in Common Controls 2. Private Sub MonthView1_DateDblClick(ByVal DateDblClicked As Date). It comes in handy when using the MonthView as a pop-up control, and double-clicking on the date selects it and closes the popup.
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
hausman
FYI, I had changed the Attribute Text.VB_UserMemId = 0 to accomplish this. Not sure which method is best.
DateDblClick is an event in the stock MonthView control in Common Controls 2. Private Sub MonthView1_DateDblClick(ByVal DateDblClicked As Date). It comes in handy when using the MonthView as a pop-up control, and double-clicking on the date selects it and closes the popup.
The Text property cannot have the DISPID_TEXT and DISPID_DEFAULT at the same time. Thus the hidden helper property.
DateDblClick - ooh missed that one. However, the MonthView (SysMonthCal32 window) doesn't have the CS_DBLCLKS style, so it won't fire any WM_LBUTTONDBLCLK.
-
Re: CommonControls (Replacement of the MS common controls)
hi krool
i wanted to Create a ComboBox inside a Listview as the demo in the link but it is not possible.
The demo works fine with the MS common listview
Create a ComboBox inside a Listview
the error type mismatch occurs here
Code:
Public Sub GetLVCellData(pobjLV As ListView, _
psngX As Single, _
psngY As Single, _
ByRef pstrCellText As String, _
ByRef plngItemIndex As Long, _
ByRef plngSubItemIndex As Long)
Dim HTI As LVHITTESTINFO
Dim lst As ListItem
With HTI
.pt.X = (psngX \ Screen.TwipsPerPixelX)
.pt.Y = (psngY \ Screen.TwipsPerPixelY)
.Flags = LVHT_ONITEM
End With
SendMessage pobjLV.hwnd, LVM_SUBITEMHITTEST, 0, HTI
If (HTI.iItem > -1) Then
Set lst = pobjLV.ListItems(HTI.iItem + 1)
plngItemIndex = HTI.iItem + 1
plngSubItemIndex = HTI.iSubItem
If HTI.iSubItem = 0 Then
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).Text
Else
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).SubItems(HTI.iSubItem)
End If
Else
pstrCellText = ""
plngItemIndex = 0
plngSubItemIndex = 0
End If
End Sub
Code:
GetLVCellData lvwDemo, _
X, _
Y, _
mstrOriginalCellText, _
mlngClickedItemIndex, _
mlngClickedSubItemIndex
-
Re: CommonControls (Replacement of the MS common controls)
Quote:
Originally Posted by
Mustaphi
hi krool
i wanted to Create a ComboBox inside a Listview as the demo in the link but it is not possible.
The demo works fine with the MS common listview
Create a ComboBox inside a Listview
the error type mismatch occurs here
Code:
Public Sub GetLVCellData(pobjLV As ListView, _
psngX As Single, _
psngY As Single, _
ByRef pstrCellText As String, _
ByRef plngItemIndex As Long, _
ByRef plngSubItemIndex As Long)
Dim HTI As LVHITTESTINFO
Dim lst As ListItem
With HTI
.pt.X = (psngX \ Screen.TwipsPerPixelX)
.pt.Y = (psngY \ Screen.TwipsPerPixelY)
.Flags = LVHT_ONITEM
End With
SendMessage pobjLV.hwnd, LVM_SUBITEMHITTEST, 0, HTI
If (HTI.iItem > -1) Then
Set lst = pobjLV.ListItems(HTI.iItem + 1)
plngItemIndex = HTI.iItem + 1
plngSubItemIndex = HTI.iSubItem
If HTI.iSubItem = 0 Then
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).Text
Else
pstrCellText = pobjLV.ListItems(HTI.iItem + 1).SubItems(HTI.iSubItem)
End If
Else
pstrCellText = ""
plngItemIndex = 0
plngSubItemIndex = 0
End If
End Sub
Code:
GetLVCellData lvwDemo, _
X, _
Y, _
mstrOriginalCellText, _
mlngClickedItemIndex, _
mlngClickedSubItemIndex
It's LvwListItem and not anymore ListItem. Also please remove the references to MS common controls.
-
Re: CommonControls (Replacement of the MS common controls)
It's simple to implement that?
In the past years, I had added the manifest in my project. Hower the project was too slow
-
Re: CommonControls (Replacement of the MS common controls)
Hi Krool, is it possible to fix columns in the listview control, like it is with the VBFlexGrid control?
-
1 Attachment(s)
Re: CommonControls (Replacement of the MS common controls)
Hello Krool,
I think I found a bug in the ComboBoxW: the Text property cannot be changed from inside the Click event.
To test it, add a VB.Combo and a ComboBoxW to a form, default style Dropdown List, and this code:
Code:
Private Sub Form_Load()
Combo1.AddItem "Item 1"
Combo1.AddItem "Item 2"
Combo1.AddItem "Item 3"
ComboBoxW1.AddItem "Item 1"
ComboBoxW1.AddItem "Item 2"
ComboBoxW1.AddItem "Item 3"
End Sub
Private Sub Combo1_Click()
Combo1.Text = Combo1.Text & " (" & Combo1.ListIndex & ")"
End Sub
Private Sub ComboBoxW1_Click()
ComboBoxW1.Text = ComboBoxW1.Text & " (" & ComboBoxW1.ListIndex & ")"
End Sub
PS: I'm using the OCX