-
Feb 27th, 2021, 05:37 AM
#441
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Schmidt
@Krool (regarding AutoSize)
It might be worth mentioning, that samer22 is probably using your Grid in bound mode
(via IVBFlexDataSource).
On my system, when I use such a Binding - and then call AutoSize in this way (for Col-Autosizing, after setting the Binding):
FG.AutoSize 0, FG.Cols - 1, FlexAutoSizeModeColWidth, FlexAutoSizeScopeAll
It seems to use the right "internal Measurement-Texts" only for the Header-Row
(probably because it did buffer these texts internally already, after retrieving them via IVBFlexDataSource_GetFieldName).
The "CellTexts below the Header" (corresponding with IVBFlexDataSource_GetData) -
are apparently not requested when it comes to further Text-measurings "down the lines".
On another note (not really related to the IVBFlexDataSource-problems above)...
Is it intentional, that an AutoSize-Call like:
FG.AutoSize 0 'which leaves the second optional Param at -1
currently does have the same effect as: FG.AutoSize 0, 0
I'm aware that this is probably meant to work this way (to affect only a single column).
What "threw me off" is the "-1" in the optional second param, which usually means "all of them".
so, the behaviour I expected, leaving the second param out, was: FG.AutoSize 0, FG.Cols - 1
Thanks for your comments.
It is indeed a bug. The AutoSize should fetch the data via IVBFlexDataSource_GetData, if applicable.
I will fix it soon.
Concerning the second optional param.
Well, it is meant to affect only a single row or column if the second parameter is omitted.
Maybe it would be "nicer" to have the second parameter as a Variant and to check with IsMissing().
That way the -1 in the intellisense would not "mislead" somebody.
However, I will keep it unchanged to not break compatibility.
-
Feb 27th, 2021, 03:00 PM
#442
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Update released.
The AutoSize method now works when using a custom data source. (IVBFlexDataSource)
In addition I allowed the FindItem function when using a custom data source.
So, of course it is the best to perform searches directly in the custom data source.
However, when switching a VBFlexGrid from "normal" to "virtual" (IVBFlexDataSource) then it may be easier to allow the FindItem function.
Anyhow, better allow and support something (even when it makes maybe not 100% sense) then to restrict it.
The only thing which remains restricted now for a custom data source is the sorting functionality.
Of course, it will keep restricted as sorting must be done in the custom data source. It can't be done in the grid.
-
Feb 27th, 2021, 05:29 PM
#443
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hello Krool
Thank you very much for the efforts you are doing.
Excuse me I have no experience with the Flexgrid control.
I have downloaded the new version and began testing the autosize codes you provided.
Code:
VBFlexGrid1.Clear
VBFlexGrid1.Refresh
With VBFlexGrid1
.AddItem ""
.TextMatrix(1, 1) = "test data"
.TextMatrix(1, 2) = "test data"
.AddItem ""
.TextMatrix(2, 1) = "test data test data test data test data test data"
.TextMatrix(2, 2) = "test data test data test data test data test data"
.AddItem ""
.TextMatrix(3, 1) = "test data test data test data test"
.TextMatrix(3, 2) = "test data test data test data test"
End With
Then I tested all your codes hoping to get this:
Attachment 180344
unfortunately no success.
-
Feb 27th, 2021, 05:53 PM
#444
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Where do you call the autosize method?
-
Feb 27th, 2021, 05:59 PM
#445
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Arnoutdv
Where do you call the autosize method?
after the code of populating the VBFlexGrid
-
Feb 28th, 2021, 04:25 AM
#446
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Better create a new thread and then show the code you use currently and doesn’t work for you
-
Feb 28th, 2021, 11:41 AM
#447
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Arnoutdv
Better create a new thread and then show the code you use currently and doesn’t work for you
Have you tested the autosize codes?
Did they work for you?
thank you
This what I have done
Code:
With VBFlexGrid1
.AddItem ""
.TextMatrix(1, 1) = "test data"
.TextMatrix(1, 2) = "test data"
.AddItem ""
.TextMatrix(2, 1) = "test data test data test data test data test data"
.TextMatrix(2, 2) = "test data test data test data test data test data"
.AddItem ""
.TextMatrix(3, 1) = "test data test data test data test"
.TextMatrix(3, 2) = "test data test data test data test"
.AutoSize 0, VBFlexGrid1.Rows - 1, FlexAutoSizeModeRowHeight
'.AutoSize VBFlexGrid1.FixedRows, VBFlexGrid1.Rows - 1, FlexAutoSizeModeRowHeight
End With
This is what I get
But this is what I expect
Edit:
I noticed that the codes work when adding carriage return.
Code:
.TextMatrix(2, 1) = "test data test" & vbNewLine & " data test data" & vbNewLine & " test data test data"
.TextMatrix(2, 2) = "test data test" & vbNewLine & " data test data" & vbNewLine & " test data test data"
I wonder if it is possible to adjust the height without inserting the carriage return as I'm feeding my grid from database.
Last edited by samer22; Feb 28th, 2021 at 12:31 PM.
-
Feb 28th, 2021, 01:28 PM
#448
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Schmidt
What "threw me off" is the "-1" in the optional second param, which usually means "all of them".
so, the behaviour I expected, leaving the second param out, was: FG.AutoSize 0, FG.Cols - 1
Obviously the vsFlexGrid handles it the same way.
Col2 is optional. If it is omitted, only Col1 is resized.
Code:
[form!]VSFlexGrid.AutoSize Col1 As Long, [ Col2 As Long ], [ Equal As Boolean ], [ ExtraSpace As Single ]
http://helpcentral.componentone.com/...sizemethod.htm
So, it's all good as it is..
-
Feb 28th, 2021, 04:53 PM
#449
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Update released.
There will be a next 1.5 OCX of the VBFlexGrid in future. Some features in mind are planned to be added, e.g. FrozenRows/Cols, ListBox style SelectionMode etc...
As first step the MousePointer property is not anymore 'As Integer' with IPerPropertyBrowsing.
It now uses a straight 'FlexMousePointerConstants' enum which will work in a VBA environment. (IPerPropertyBrowsing not supported in VBA)
Also a first new feature the EditContextMenu event is added. The Handled parameter can be set to True to suppress the default text box style dropdown menu. (in order to provide an own menu, e.g. Me.PopupMenu xyz)
-
Mar 2nd, 2021, 12:28 PM
#450
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by samer22
I noticed that the codes work when adding carriage return.
Code:
.TextMatrix(2, 1) = "test data test" & vbNewLine & " data test data" & vbNewLine & " test data test data"
.TextMatrix(2, 2) = "test data test" & vbNewLine & " data test data" & vbNewLine & " test data test data"
I wonder if it is possible to adjust the height without inserting the carriage return as I'm feeding my grid from database.
Yes, word wrapping is not "considered" in the grid's TextWidth/TextHeight functions. (Which the AutoSize function uses)
But there are reasons that it is good like that, e.g. to auto size a column wide enough that word wrapping is not needed anymore.
I need to think about additional functionality to solve your problem, which returns then the "ideal text height" incl. word wrapping.
EDIT: Bugfix in the TextHeight function. It returned 0 on an empty string. But it must return TMHeight (TEXTMETRIC) in that case.
TextWidth remains unchanged and keeps returning 0 on empty strings.
Last edited by Krool; Mar 2nd, 2021 at 04:56 PM.
-
Mar 2nd, 2021, 08:51 PM
#451
Addicted Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
Update released.
There will be a next 1.5 OCX of the VBFlexGrid in future. Some features in mind are planned to be added, e.g. FrozenRows/Cols, ListBox style SelectionMode etc...
As first step the MousePointer property is not anymore 'As Integer' with IPerPropertyBrowsing.
It now uses a straight 'FlexMousePointerConstants' enum which will work in a VBA environment. (IPerPropertyBrowsing not supported in VBA)
Also a first new feature the EditContextMenu event is added. The Handled parameter can be set to True to suppress the default text box style dropdown menu. (in order to provide an own menu, e.g. Me.PopupMenu xyz)
may i request filterbar in top of column, much like excel style, maybe we can programmatically code on event filterbar
-
Mar 3rd, 2021, 03:30 AM
#452
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by jedifuk
may i request filterbar in top of column, much like excel style, maybe we can programmatically code on event filterbar
If the Frozen rows/cols are implemented such a filter bar could be done "manually". (In conjunction with AllowUserEditing)
-
Mar 3rd, 2021, 04:06 AM
#453
Addicted Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
If the Frozen rows/cols are implemented such a filter bar could be done "manually". (In conjunction with AllowUserEditing)
nice to know about it..let me take a look
-
Mar 5th, 2021, 05:53 PM
#454
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Major update released.
FrozenRows/FrozenCols property now included. (editable but non-scrollable cells)
I investigated quite a time for that new feature. However, it may be possible that it may have initial bugs as it is in it's infancy.
Please report any mis-behavior. Thanks
Also please advise if any specific related properties directly related to frozen cells are needed/wanted. Currently it shares all "formatting" from the normal (scrollable) cells.
-
Mar 8th, 2021, 08:11 AM
#455
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by samer22
I wonder if it is possible to adjust the height without inserting the carriage return as I'm feeding my grid from database.
You need basically the "label height" as the grid uses for drawing.
I struggle currently how to "expose" this functionality?
Adding a mode enum in the AutoSize method "IdealRowHeight". (Beside the existing "ColWidth" and "RowHeight" modes)
Or?
-
Mar 8th, 2021, 08:17 AM
#456
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Krool,
The vsFlexGrid also has an .AutoSize method.
If the .WordWrap property is set to True and you use .AutoSizeMode = flexAutoSizeRowHeight and then call .AutoSize the RowHeights will be adapted to the needed height to fit the cell content.
Resizes column widths or row heights to fit cell contents.
Syntax
[form!]VSFlexGrid.AutoSize Col1 As Long, [ Col2 As Long ], [ Equal As Boolean ], [ ExtraSpace As Single ]
Remarks
The parameters for the AutoSize method are described below:
Col1 As Long, Col2 As Long
Specify the first and last columns to be resized so their widths fit the widest entry in each column. The valid range for these parameters is between 0 and Cols -1. Col2 is optional. If it is omitted, only Col1 is resized.
Equal As Boolean (optional)
If True, all columns between Col1 and Col2 are set to the same width. If False, then each column is resized independently. This parameter is optional and defaults to False.
ExtraSpace As Single (optional)
Allows you to specify extra spacing, in twips, to be added in addition to the minimum required to fit the widest entry. This is often useful if you wish to leave extra room for pictures or margins within cells. This parameter is optional and defaults to zero.
The AutoSize method may also be used to resize row heights. This is useful when text is allowed to wrap within cells (see the WordWrap property) or when cells have fonts of different sizes (see the Cell property).
The AutoSizeMode property determines whether AutoSize will adjust column widths or row heights.
-
Mar 8th, 2021, 04:19 PM
#457
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Update released.
AutoSize method works now as expected if WordWrap = True and Mode = FlexAutoSizeModeRowHeight.
AutoSize method works now also as expected if SingleLine = True. (Bugfix in the internal 'GetTextSize' function)
Some additional info
New internal function added 'GetTextHeight' which the AutoSize method now uses for Mode = FlexAutoSizeModeRowHeight.
The internal function 'GetTextSize' (CX and CY) remains unchanged. The AutoSize method for Mode = FlexAutoSizeModeColWidth will still use the CX member of the 'GetTextSize' function. (which is intended to be)
If WordWrap = False the CY member of 'GetTextSize' and the result of 'GetTextHeight' is the same.
@Samer22, your auto sizing should work now as expected.
Last edited by Krool; Mar 8th, 2021 at 04:32 PM.
-
Mar 9th, 2021, 07:51 AM
#458
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
hi,this is my quesion in Thread: am looking for convert ansi to windows-1256 or utf-8 to wndows-1256 without digit prb
somebody in my thread told about use inkedit for show unicode now my problem is about show that data in grid,i searched for a datagird support unicode and find this thread,inkedit saved my data like as rtf i showed in #24 in my thread
like as
HTML Code:
{\rtf1\fbidis\ansi\ansicpg1256\deff0\deflang1065{\fonttbl{\f0\fnil\fcharset178{\*\fname Tahoma;}Tahoma (barnameha.net);}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\ltrpar\qr\f0\rtlch\fs18\'c2\'81\'c7\'d1\'ca\'e3\'c7\'e4 \u1785?\u1782? \'e3\'ca\'d1 \'cf\'d1 \'d4\'d1\u1740?\'da\'ca\u1740?\par
}
and will be show in inkedit like as :
HTML Code:
{"date":"۳ روز پیش"}
but how can show this data in this grid? or any sample to i can save unicode ( utf-8) data in access database and show it in datagrid?
-
Mar 11th, 2021, 12:09 PM
#459
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Any ideas which features you miss?
I have only ListBox style SelectionMode on my list. However, maybe the list can get longer. (?)
-
Mar 11th, 2021, 04:10 PM
#460
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
all my description :
i am use adodc1 linked to a simple datagrid and some textboxes with datasource and datafield properties.
so when i clicked on movenext or movefirst or ... on adodc,datagrid can move automatically to move first or next record or ...
i searched for datagrid support unicode and a simple sample to how save and show in grid.
but i can find trial or unsupport unicode or unsupport datasource properties like as datagrid.
i like free userconrrol listview or datagrid to show like as this :
https://10tec.com/activex-grid/extra-samples.aspx section RTF text cells
its igrid but not free and its not user control , this is jst ocx.this is a sample for custom draw.
its show rtf too but its ok if i cant show rtf but its important to i can show in listview or grid and can link to adodc for naviagte automatically with adodc1 move records.
or i checked by LynxGrid vb6 and bind controls :
images attached :
Attachment 180537
Attachment 180538
Attachment 180539
but this usr control have problem because LynxGrid can bind controls for when i want edit some cells not like as show normal in rows and have another bug too.
my iedea is about like as igrid can support custom draw and bind controls for normal show or editable show.
if u can send a sample with your list view and jst like this:
-used 1adodc linked to listview and for navigation between records.
-1 textbox linked to adodc datafield for show unicode or enter unicode data
-and a button for add and save a record .
or for better simple: just send a sample project to how use your listview for show add unicode data in access database and show in list view linked to adodc or any your idea
i need just sample project about how save and show unicode data in list view or girds
Last edited by Black_Storm; Mar 11th, 2021 at 04:18 PM.
-
Mar 12th, 2021, 08:57 AM
#461
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I think an Copy method would be good.
Also a ClipboardCopyMode property in conjunction. (specifies if copying only movable cells or also fixed cells)
Currently I handle it manually, copy to clipboard (via KeyDown, vbKeyC). Also manually copying the fixed header text if vbKeyC + Shift.
This all could be automized by the control itself, reducing then (at least for me) some app specific coding.
Question: Would be a Copy method sufficient or is there also a need to get the "CopyText" so that the app can put it in the clipboard by his own ?
-
Mar 12th, 2021, 09:53 AM
#462
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
I think an Copy method would be good.
...
Question: Would be a Copy method sufficient or is there also a need to get the "CopyText" so that the app can put it in the clipboard by his own ?
I'd say, that's already covered by the existing .Clip-Method(s) (in conjunction with ClipMode and ClipSeparators)...
Maybe check, whether the .Clip-method will work properly also in IVBFlexDataSource-Binding-mode...
IIRC, Clip works on a range, which has to be set explicitely beforehand via:
.Row = ...
.Col = ...
.Rows = ...
.Cols = ...
To make Clip (and other methods which work on a selected Range) more convenient, a Range-Select-method like:
SelectRange(Row, Col, Optional Byval Rows& = -1, Optional Byval Cols& = -1)
would be nice.
Olaf
-
Mar 12th, 2021, 10:09 AM
#463
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Schmidt
I'd say, that's already covered by the existing .Clip-Method(s) (in conjunction with ClipMode and ClipSeparators)...
Maybe check, whether the .Clip-method will work properly also in IVBFlexDataSource-Binding-mode...
IIRC, Clip works on a range, which has to be set explicitely beforehand via:
.Row = ...
.Col = ...
.Rows = ...
.Cols = ...
To make Clip (and other methods which work on a selected Range) more convenient, a Range-Select-method like:
SelectRange(Row, Col, Optional Byval Rows& = -1, Optional Byval Cols& = -1)
would be nice.
Olaf
Yes. Maybe extending the ClipMode property would be sufficient, e.g. FixedRows/FixedCols ?
Last edited by Krool; Mar 12th, 2021 at 11:05 AM.
-
Mar 12th, 2021, 12:56 PM
#464
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
Yes. Maybe extending the ClipMode property would be sufficient, e.g. FixedRows/FixedCols ?
If you're searching for an easy way, to include the FixedRows/Cols in the Clip,
then why not add this new "clever" SelectRange-method...
Currently (to include the Headers in a "full Clip"), I have to write:
Code:
FG.Row = 0
FG.Col = 0
FG.RowSel = FG.Rows - 1
FG.ColSel = FG.Cols - 1
Debug.Print FG.Clip
With the new Method I could write (to include the Headers in a full Clip):
Code:
FG.SelectRange 0, 0 'leaving the last two optional Params out, selects "all the rest"
Debug.Print FG.Clip
Or in case I want to exclude the Headers from a full Clip:
Code:
FG.SelectRange FG.FixedRows, FG.FixedCols 'leaving the last two optional Params out, selects "all the rest"
Debug.Print FG.Clip
All ensured with minimal fuss (no extra ClipMode-Enum-members needed) via this new SelectRange-Method
(which, as said, will probably come in handy also for "larger formatting-ops", not only for clipping).
Olaf
-
Mar 12th, 2021, 02:41 PM
#465
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Schmidt
If you're searching for an easy way, to include the FixedRows/Cols in the Clip,
then why not add this new "clever" SelectRange-method...
Currently (to include the Headers in a "full Clip"), I have to write:
Code:
FG.Row = 0
FG.Col = 0
FG.RowSel = FG.Rows - 1
FG.ColSel = FG.Cols - 1
Debug.Print FG.Clip
With the new Method I could write (to include the Headers in a full Clip):
Code:
FG.SelectRange 0, 0 'leaving the last two optional Params out, selects "all the rest"
Debug.Print FG.Clip
Or in case I want to exclude the Headers from a full Clip:
Code:
FG.SelectRange FG.FixedRows, FG.FixedCols 'leaving the last two optional Params out, selects "all the rest"
Debug.Print FG.Clip
All ensured with minimal fuss (no extra ClipMode-Enum-members needed) via this new SelectRange-Method
(which, as said, will probably come in handy also for "larger formatting-ops", not only for clipping).
Olaf
The vsFlexGrid's Select method will select only a single cell when the two optional parameter's are omitted. So what now?
Your sample will get clip text "all". But what about getting only the current selection + field captions from a Clip.
Imagine I copy 1 row in the middle of a grid into excel. I want the fixed rows field name plus the 1 selected row.
-
Mar 12th, 2021, 04:08 PM
#466
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
The vsFlexGrid's Select method will select only a single cell when the two optional parameter's are omitted. So what now?
Since you remained compatible to the vsFlex also in the AutoSize-Method already,
you should probably "keep that compatibility up" consistently (was not aware about the Select-Method on the vsFlex).
Originally Posted by Krool
Your sample will get clip text "all". But what about getting only the current selection + field captions from a Clip.
Imagine I copy 1 row in the middle of a grid into excel. I want the fixed rows field name plus the 1 selected row.
Ah, ... if that's the scenario you planned to use these new Enum-Values for -
then "why not" (I thought only about "consecutive selections without gaps").
An enum would also work easier, when you want to support Ctrl+C directly within the Control.
Olaf
-
Mar 15th, 2021, 01:03 PM
#467
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
I think an Copy method would be good.
Also a ClipboardCopyMode property in conjunction. (specifies if copying only movable cells or also fixed cells)
Currently I handle it manually, copy to clipboard (via KeyDown, vbKeyC). Also manually copying the fixed header text if vbKeyC + Shift.
This all could be automized by the control itself, reducing then (at least for me) some app specific coding.
Question: Would be a Copy method sufficient or is there also a need to get the "CopyText" so that the app can put it in the clipboard by his own ?
i said what i need in #460.
its ok for use any way but i need sample project just a access database,adodc and your list view (show utf and save in database).
my language is not english so i cant understand some descriptions.but i am waiting jst for any sample project or any other way for fix this problem like as use others user controls if exist or ....
-
Mar 15th, 2021, 05:19 PM
#468
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
The codebank is not the place in which you can ask for a complete sample project with such a lot of requirements.
Better create a thread in the normal forum in which you ask if someone can help you with a sample project which uses the vbFlexGrid (it's not a ListView!!!) and UTF8.
-
Mar 16th, 2021, 03:52 PM
#469
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
am still waiting here for a simple sample ...
-
Mar 16th, 2021, 05:36 PM
#470
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Arnoutdv
The codebank is not the place in which you can ask for a complete sample project with such a lot of requirements.
Better create a thread in the normal forum in which you ask if someone can help you with a sample project which uses the vbFlexGrid (it's not a ListView!!!) and UTF8.
you should be read #458 i asked with that links and its not about just complete samples,i send texts like as any sample code or any simple or any other way and ... that means any sample codes or simple use or like this ..., and yes i can ask about vbFlexGrid and utf-8 or ... but i ask here because its about this grid because its support utf-8.i will be ask if i cant find a way here.
Last edited by Black_Storm; Mar 16th, 2021 at 05:43 PM.
-
Mar 16th, 2021, 07:37 PM
#471
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Black_Storm
you should be read #458 ...
When you ask about (virtual) DataBinding of Krools VbFlexgrid (to Recordsets) -
that's possible without larger efforts via the IVBFlexDataSource interface.
Not sure, whether somebody already wrote a Binding-example for ADO-Rs -
but for SQLite-Rs I've posted several already... the most recent one here:
https://www.vbforums.com/showthread....=1#post5514140
As for your "utf-8"-stuff...
UFT-8 is just "a leaner encoding-variant" (compared to UTF-16, which is directly supported by BStrings/WStrings and the usual *W-APIs of the system).
The VBFlexGrid is Unicode-aware (capable to render the UTF16-content, which is usually contained in VB-Strings) -
period... as are ADO- or SQLite-Recordsets when they transport String-Data back and forth from/to the underlying DB-Engines...
It is entirely up to you, to "not mess up the String-handling-chain"...
meaning that, when you put an "already wrongly decoded String" into the DB in the first place,
then neither an unicode-aware Recordset, nor an unicode-aware Grid-Rendering can fix that faulty String-content.
And BTW, the MS-ADODC-Control you are using is not unicode-aware (it messes up the String-content, even when Unicode-aware ADO-Rs and Unicode-aware TextBox-Controls are connected over it).
I've addressed that with an alternative (Unicode-aware) Binding-mechanism here:
https://www.vbforums.com/showthread....inding-Control
Olaf
-
Apr 22nd, 2021, 12:02 PM
#472
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hello Krool, excellent grid control, what I would suggest is to add very important functions such as:
1.- That you have the option of sorting in ascending and descending order by clicking on the column header.
2.- A very important one that acquires the windows theme regardless of the version for a better appearance.
3.- The selectionbyrow row that is in the style of windows 7.
4.- add Extendedlastcol to the property. equal to that of the VsFlexgrid8.
Thank you very much for your effort and your work.
-
Apr 25th, 2021, 10:31 AM
#473
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
The cell is set with a picture background, and the words can’t be seen clearly. Shadow font or luminous font?
How to set the control to be transparent?
How to set the overall background image of the control
-
Apr 27th, 2021, 01:58 AM
#474
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by xiaoyao
The cell is set with a picture background, and the words can’t be seen clearly. Shadow font or luminous font?
How to set the control to be transparent?
How to set the overall background image of the control
for CellPictureAlignemnt 9 - Stretch there is no "NoOverlap" variant. Maybe some of these are suitable?
Code:
FlexPictureAlignmentLeftTopNoOverlap = 20
FlexPictureAlignmentLeftCenterNoOverlap = 21
FlexPictureAlignmentLeftBottomNoOverlap = 22
FlexPictureAlignmentRightTopNoOverlap = 26
FlexPictureAlignmentRightCenterNoOverlap = 27
FlexPictureAlignmentRightBottomNoOverlap = 28
The control can't be transparent/overall background image. However, if you want you can subclass WM_ERASEBKGND and draw a fake replica of the underlying image/overall background image.
The control is designed to react properly when an app handles WM_ERASEBKGND.
WM_ERASEBKGND is only for the part that is covered by the "BackColorBkg" portion.
However, if you want an overall background image for the cell contents, there is no possibility yet. (like an watermark in the ListView)
Will keep that in mind..
-
May 3rd, 2021, 05:22 AM
#475
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Updated released. (bugfix)
When having two MDI child forms each having a VBFlexGrid, then clicking on the other VBFlexGrid in the other MDI child form will get focused but the MDI child window is not "activated".
I was baffled that it boiled down to the WS_EX_NOPARENTNOTIFY bit set in the window creation. It got now removed.
-
May 3rd, 2021, 10:43 PM
#476
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
how to use WM_ERASEBKGND?
if i put control in picturebox,backimage is PICTUREBOX -PICTURE
IF PUT ON FORM1,IT'S form1.picture?
if i want to change by code ,how to do?
because i will change form backround img for more times
-
May 3rd, 2021, 10:46 PM
#477
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
if i use cell back picture,font need two color,like black color,and with White or yellow border, realize the function of shadow font。
textout for two times?
-
May 4th, 2021, 10:39 AM
#478
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Krool
for CellPictureAlignemnt 9 - Stretch there is no "NoOverlap" variant. Maybe some of these are suitable?
Code:
FlexPictureAlignmentLeftTopNoOverlap = 20
FlexPictureAlignmentLeftCenterNoOverlap = 21
FlexPictureAlignmentLeftBottomNoOverlap = 22
FlexPictureAlignmentRightTopNoOverlap = 26
FlexPictureAlignmentRightCenterNoOverlap = 27
FlexPictureAlignmentRightBottomNoOverlap = 28
The control can't be transparent/overall background image. However, if you want you can subclass WM_ERASEBKGND and draw a fake replica of the underlying image/overall background image.
The control is designed to react properly when an app handles WM_ERASEBKGND.
WM_ERASEBKGND is only for the part that is covered by the "BackColorBkg" portion.
However, if you want an overall background image for the cell contents, there is no possibility yet. (like an watermark in the ListView)
Will keep that in mind..
Very Nice,Transparent user control by vb6-VBForums
https://www.vbforums.com/showthread....control-by-vb6
Inspired by you, I wrote a module, you can see if you can add it
Code:
hDC = GetDC(0)
BitMap = CreateCompatibleBitmap(hDC, WinRect1.Right - WinRect1.Left, WinRect1.Bottom - WinRect1.Top)
Call ReleaseDC(0, hDC)
memDC = CreateCompatibleDC(0)
oldBitMap = SelectObject(memDC, BitMap)
Call SendMessage(ParentHwnd, WM_ERASEBKGND, memDC, 0)
Call SendMessage(ParentHwnd, WM_PAINT, memDC, 0)
Case WM_PAINT
if SendMessage(hWnd, WM_ERASEBKGND, hDCBmp, ByVal 0&) = 0 Then
If VBFlexGridBackColorBkgBrush <> 0 Then FillRect hDCBmp, VBFlexGridClientRect, VBFlexGridBackColorBkgBrush
14000 lines of code, my ability is limited and I can’t modify it. Could you please help me to see if there is a place to add a background image, or copy the image of the parent object
Last edited by xiaoyao; May 4th, 2021 at 11:02 AM.
-
May 4th, 2021, 12:07 PM
#479
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Kroll, Could you please implement these details in the VBFlexgrid? quoted in this thread:
https://www.vbforums.com/showthread....=1#post5519010
Thank you
-
May 4th, 2021, 01:26 PM
#480
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
1.- That you have the option of sorting in ascending and descending order by clicking on the column header.
2.- A very important one that acquires the windows theme regardless of the version for a better appearance.
3.- The selectionbyrow row that is in the style of windows 7.
4.- add Extendedlastcol to the property. equal to that of the VsFlexgrid8.
1. This you can implement yourself using the sort methods and properties and using the MouseUp/MouseDown/Click events provided by the grid.
2 & 3, that's very specific for your use case maybe
4. That would be convenient
Last edited by Arnoutdv; May 4th, 2021 at 05:39 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|