Page 12 of 34 FirstFirst ... 2910111213141522 ... LastLast
Results 441 to 480 of 1324

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

  1. #441

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Schmidt View Post
    @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.

  2. #442

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    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.

  3. #443
    Fanatic Member
    Join Date
    Oct 2013
    Posts
    783

    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
    Name:  flex.png
Views: 1226
Size:  3.2 KB
    unfortunately no success.

  4. #444
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Where do you call the autosize method?

  5. #445
    Fanatic Member
    Join Date
    Oct 2013
    Posts
    783

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Arnoutdv View Post
    Where do you call the autosize method?
    after the code of populating the VBFlexGrid

  6. #446
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    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

  7. #447
    Fanatic Member
    Join Date
    Oct 2013
    Posts
    783

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Arnoutdv View Post
    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

    Name:  flex1.png
Views: 1205
Size:  2.7 KB

    But this is what I expect

    Name:  flex.png
Views: 1233
Size:  3.2 KB

    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.

  8. #448

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Schmidt View Post
    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..

  9. #449

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    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)

  10. #450

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by samer22 View Post
    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.

  11. #451
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    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

  12. #452

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by jedifuk View Post
    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)

  13. #453
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    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

  14. #454

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    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.

  15. #455

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by samer22 View Post
    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?

  16. #456
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    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.

  17. #457

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    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.

  18. #458
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    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?

  19. #459

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    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. (?)

  20. #460
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    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
    Attached Images Attached Images    
    Last edited by Black_Storm; Mar 11th, 2021 at 04:18 PM.

  21. #461

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    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 ?

  22. #462
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    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

  23. #463

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Schmidt View Post
    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.

  24. #464
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    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

  25. #465

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Schmidt View Post
    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.

  26. #466
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    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).

    Quote Originally Posted by Krool View Post
    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

  27. #467
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    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 ....

  28. #468
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    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.

  29. #469
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    am still waiting here for a simple sample ...

  30. #470
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Arnoutdv View Post
    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.

  31. #471
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Black_Storm View Post
    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

  32. #472
    Member
    Join Date
    Apr 2021
    Posts
    44

    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.

  33. #473
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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
    Name:  VBFlexGridPicture.jpg
Views: 822
Size:  49.2 KB

  34. #474

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by xiaoyao View Post
    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..

  35. #475

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,375

    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.

  36. #476
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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

  37. #477
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    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?


  38. #478
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Krool View Post
    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.

  39. #479
    Member
    Join Date
    Apr 2021
    Posts
    44

    Lightbulb 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

  40. #480
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    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.

Page 12 of 34 FirstFirst ... 2910111213141522 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width