|
-
Feb 8th, 2024, 04:11 PM
#1241
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Delete respects now the ClipMode (= ExcludeHidden)
Doesn't work for me.
Code:
Private Sub Command1_Click()
With VBFlexGrid1
.ClipPasteMode = FlexClipPasteModeNormal
.Col = 1: .Row = 1
.ColSel = 3: .RowSel = 2
.ColHidden(2) = True
.Delete ' The hidden col(2) was cleaned too
' .Clear FlexClearClip, FlexClearText
.ColHidden(2) = False
.SetFocus
End With
End Sub
-
Feb 9th, 2024, 03:24 AM
#1242
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
Doesn't work for me.
Code:
Private Sub Command1_Click()
With VBFlexGrid1
.ClipPasteMode = FlexClipPasteModeNormal
.Col = 1: .Row = 1
.ColSel = 3: .RowSel = 2
.ColHidden(2) = True
.Delete ' The hidden col(2) was cleaned too
' .Clear FlexClearClip, FlexClearText
.ColHidden(2) = False
.SetFocus
End With
End Sub
Delete "respects" the ClipMode property. By that you need to set it of course to ExcludeHidden.
Add below code and it suddenly works.
Code:
.ClipMode = FlexClipModeExcludeHidden
-
Feb 9th, 2024, 03:55 AM
#1243
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
By that you need to set it of course to ExcludeHidden.
-
Feb 9th, 2024, 06:17 AM
#1244
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Included enum FlexDirectionAfterReturnEdit/FlexEditReasonReturn.
By this the edit mode is initiated by the return key, but only when shift state is 0.
It is intentionality included in the DirectionAfterReturn property to not change default behavior and it's logical because you can either move the cursor or start edit mode, but not both.
The OCX VBFLXGRD17 was also updated. The internal type lib version is now 1.5.
Code:
Object={2DA70529-3366-414A-B408-46083BCD481B}#1.5#0; VBFLXGRD17.OCX
-
Feb 9th, 2024, 08:11 AM
#1245
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Krool, did you notice my message?
-
Feb 9th, 2024, 08:19 AM
#1246
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
A bug?
Code:
Private Sub Command1_Click()
With VBFlexGrid1
.Align = vbAlignTop ' If Align = vbAlignTop
Set .Container = Picture1 ' and the Container is set to a PictureBox
.ScrollBars = vbVertical ' then I can't see any scrollbars.
End With
End Sub
Do you adjust the width/height of the VBFlexGrid so it fits into the PictureBox?
-
Feb 9th, 2024, 08:22 AM
#1247
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Do you adjust the width/height of the VBFlexGrid so it fits into the PictureBox?
I use the Align = vbAlignTop only. It adjusts the width. Nothing more.
-
Feb 9th, 2024, 08:49 AM
#1248
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
I use the Align = vbAlignTop only. It adjusts the width. Nothing more.
Well, the code makes no sense. Because first of all the Align property works only when placed on a Form. Not in a PictureBox.
And you set the Align "prior" to changing the container. So the FlexGrid Width is then qual to the Form Width. Is that intended by you?
If your PictureBox width is now "smaller" then guess what, you don't "see" the scrollbars.
-
Feb 9th, 2024, 09:02 AM
#1249
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Align property works only when placed on a Form.
I didn't know it. Can you fix it?
-
Feb 9th, 2024, 09:28 AM
#1250
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
I didn't know it. Can you fix it?
No I can't. Align is a vb6 property.
-
Feb 10th, 2024, 08:11 PM
#1251
New Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hello Mr. Krool,
I need your help.
I get the following error: ERROR VBCCR17 Run-time error '50003'; Unexpected error.
I have a form where I am using imagelist as an image container for a menu bar,
the icons are 16x16 pixels, generated from .svg files (with old traditional .ico no problem),
In Windows 10 I do not have any problem,
the problem occurs in some versions of windows 7 service pack 1,
I have tried it on a vm with windows 7 sp1 and it has not given me any problems.
What library do you use to load the images that may be outdated in these Windows.
-
Feb 11th, 2024, 03:26 AM
#1252
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by vb6nostalgia
Hello Mr. Krool,
I need your help.
I get the following error: ERROR VBCCR17 Run-time error '50003'; Unexpected error.
I have a form where I am using imagelist as an image container for a menu bar...
You should repost it here.
-
Feb 11th, 2024, 07:17 AM
#1253
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by TheLeePiper
Thanks so much. I looked at the vsFlexGrid API calls. For reference, the DataTable API looks like:
Datatbl1.CellSet(0,0).BorderColor = RGB(255, 0, 0)
Datatbl1.CellSet(0,0).BorderWidth = 1
CellSet can point to any arbitrary cell, CurCell to the cell with focus. Any cell where the BorderWidth is zero (the default) does not show a border. Not quite sure how this might map to the VBFlexGrid.
Borders are inside the grid, which of course, would affect ComboButton sizing (which it does with the DataTable). Just ignorantly free-thinking here, could it be a variant of the FlexCellBackColor usage? Instead of coloring the whole cell BG, it could be just an inset width? Set the right-side inset from any ComboButton so you would not need to modify the buttons? (Not quite the same as the DataTable, but would be very suitable for our needs.) Thanks again.
I am still struggling of "best way".
How about a CellGridLines property which overwrites the general grid lines?
-
Feb 11th, 2024, 10:54 AM
#1254
New Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
You should repost it here.

Thank you. I was in the wrong place.
-
Feb 11th, 2024, 12:03 PM
#1255
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Last edited by Nouyana; Feb 12th, 2024 at 12:27 PM.
-
Feb 11th, 2024, 12:07 PM
#1256
Junior Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
I am still struggling of "best way".
How about a CellGridLines property which overwrites the general grid lines?
That absolutely could work. Would this cell border thickness need to be the same as the default GridLineWidth?
Just for reference, we use cell BG colors for navigation control (i.e, to determine a tab stop for editing). For a new theme, we want to have white grid BG and grid line with "tab stop" cells that are slightly-off-white and a dark cell border for the visual indicator of these cells. (In other themes, the grid BGs are non-white and cell BGs are sufficiently different, so no border is needed. But we may add the border to these anyway for additional distinction.)
Thanks!
-
Feb 11th, 2024, 03:26 PM
#1257
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Last edited by Nouyana; Feb 12th, 2024 at 12:27 PM.
-
Feb 12th, 2024, 07:35 AM
#1258
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by TheLeePiper
That absolutely could work. Would this cell border thickness need to be the same as the default GridLineWidth?
Just for reference, we use cell BG colors for navigation control (i.e, to determine a tab stop for editing). For a new theme, we want to have white grid BG and grid line with "tab stop" cells that are slightly-off-white and a dark cell border for the visual indicator of these cells. (In other themes, the grid BGs are non-white and cell BGs are sufficiently different, so no border is needed. But we may add the border to these anyway for additional distinction.)
Thanks!
On second thought. The gridline is drawn "between" cells. So 1 physical cell does not draw the entire gridline for itself. Only half, the other half is drawn by the left and top neighbor cell.
So, I guess your request does not really "fit" for VBFlexGrid and I am afraid to reject your request until a good idea approaches.
I checked with the vsFlexGrid and the CellBorder function is not respected by anything. (focus rect, combo button etc.) so it's just a "rectangle drawn over".
-
Feb 12th, 2024, 12:06 PM
#1259
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Last edited by Nouyana; Feb 12th, 2024 at 12:17 PM.
-
Feb 12th, 2024, 12:34 PM
#1260
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Included the ColWordWrapOption/ColWordWrapOptionFixed run-time property.
This was an over-due feature missing from the MSHFlexGrid.
Now it is possible to overwrite per column from the default text formatting of the general WordWrap and SingleLine property.
Ok. Only two questions left. What is the difference between:
1. FlexWordBreakEndEllipsis and FlexWordBreakWordEllipsis.
2. FlexSingleLineEndEllipsis and FlexSingleLineWordEllipsis
-
Feb 12th, 2024, 12:48 PM
#1261
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
Ok. Only two questions left. What is the difference between:
1. FlexWordBreakEndEllipsis and FlexWordBreakWordEllipsis.
2. FlexSingleLineEndEllipsis and FlexSingleLineWordEllipsis

The difference is that the one use DT_END_ELLIPSIS and the other DT_WORD_ELLIPSIS in the DrawText API.
-
Feb 13th, 2024, 02:02 PM
#1262
Junior Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
On second thought. The gridline is drawn "between" cells. So 1 physical cell does not draw the entire gridline for itself. Only half, the other half is drawn by the left and top neighbor cell.
So, I guess your request does not really "fit" for VBFlexGrid and I am afraid to reject your request until a good idea approaches.
I checked with the vsFlexGrid and the CellBorder function is not respected by anything. (focus rect, combo button etc.) so it's just a "rectangle drawn over".
Understood. I hope you won't mind me tossing ideas from time-to-time to see if it resonates...
One thought given the order of things was to consider this in a manner similar to the FlexComboCue*. I haven't dug into your code, but I assume that you are rendering the DropDown and Button images after the grids and cell BGs are established. Could this be something like a FlexCellCueBorder, where at the same time of rendering the Combo images a border could be drawn around the grid using a defined GridColorAlt?
-
Feb 15th, 2024, 03:51 PM
#1263
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Nouyana,
thanks however for bringing this up. It seems there is a bug.
If ComboItems is "" then a "blank" item is inserted.
So I will change the behavior in next release that if ComboItems is vbNullString (StrPtr() = 0) then really no item is inserted. However, if ComboItems is "" then a "blank" item shall still be inserted.
Is it still in your roadmap?
-
Feb 15th, 2024, 04:43 PM
#1264
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
Is it still in your roadmap?
That's already implemented.
-
Feb 16th, 2024, 03:24 AM
#1265
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
That's already implemented.
Yes, I can see now that ComboListCount = 0 when ComboItems is set to vbNullString. But what I noticed is an "empty" drop-down list which is still there, unlike the standard controls. Is it by design?
Code:
Private Sub VBFlexGrid1_ComboDropDown()
With VBFlexGrid1
Debug.Print .ComboListCount ' Returns 0.
End With
End Sub
Private Sub Command1_Click()
With VBFlexGrid1
.CellComboCue = FlexComboCueDropDown
.ComboMode = FlexComboModeDropDown
' .ComboItems = vbNullString ' I can see an "empty" drop-down list
End With
With cmbCombo1 ' VB ComboBox
.AddItem "Item"
.RemoveItem 0 ' There is no drop-down list.
End With
With cmbComboBoxW1 ' CCR ComboBox
.AddItem "Item"
.RemoveItem 0 ' There is no drop-down list.
End With
End Sub
Last edited by Nouyana; Feb 16th, 2024 at 05:34 AM.
-
Feb 16th, 2024, 06:38 AM
#1266
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
20-Oct-2023
- Included enum FlexAlignmentGeneralTop/FlexAlignmentGeneralCenter/FlexAlignmentGeneralBottom.
The enum FlexAlignmentGeneral keeps valid and is the default column alignment value.
Am I understand right that there is no any difference between the FlexAlignmentGeneralCenter and FlexAlignmentGeneral constants?
And, by the way, Krool, may be you didn't know it because it's a bit undocumented. So, just as advice.
Code:
Private Enum MyEnum
[_enmFirst] = -1 ' You may keep the (-1) value here.
' This is just an invisible constant.
enm1 = 0
enm2 = 1
enm3 = 2 ' You may easy add a new constant here, but
[_enmLast] = 2 ' don't forget to update the last (invisible) constant.
End Enum
Public Property Let MyProperty(ByVal Value As MyEnum)
Select Case Value
Case [_enmFirst] To [_enmLast] ' You may use it instead of full enumeration.
Case Else
Err.Raise Number:=30005, Description:="Invalid Alignment value"
End Select
End Property
-
Feb 16th, 2024, 07:59 AM
#1267
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Nouyana
Yes, I can see now that ComboListCount = 0 when ComboItems is set to vbNullString. But what I noticed is an "empty" drop-down list which is still there, unlike the standard controls. Is it by design?
Code:
Private Sub VBFlexGrid1_ComboDropDown()
With VBFlexGrid1
Debug.Print .ComboListCount ' Returns 0.
End With
End Sub
Private Sub Command1_Click()
With VBFlexGrid1
.CellComboCue = FlexComboCueDropDown
.ComboMode = FlexComboModeDropDown
' .ComboItems = vbNullString ' I can see an "empty" drop-down list
End With
With cmbCombo1 ' VB ComboBox
.AddItem "Item"
.RemoveItem 0 ' There is no drop-down list.
End With
With cmbComboBoxW1 ' CCR ComboBox
.AddItem "Item"
.RemoveItem 0 ' There is no drop-down list.
End With
End Sub
I don't understand. In all cases the drop-down list has no items. What's exactly the issue ?
What you mean by "no drop-down list" ? Of course there is a list shown when you push the dropdown button. Also in VB ComboBox.
-
Feb 16th, 2024, 08:55 AM
#1268
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Of course there is a list shown when you push the dropdown button. Also in VB ComboBox.
Only in the VBCCR ComboBox
Code:
Private Sub cmdAddItems_Click()
With VBFlexGrid1
.CellComboCue = FlexComboCueDropDown
.ComboMode = FlexComboModeDropDown
.ComboItems = "Arnold|Bob|Charlie|David"
End With
With cmbCombo1 ' VB ComboBox, Style = 2 (Dropdown list)
.AddItem "Arnold"
.AddItem "Bob"
End With
With cmbComboBoxW1 ' CCR ComboBox, Style = 2 (Dropdown list)
.AddItem "Arnold"
.AddItem "Bob"
End With
End Sub
Private Sub cmdRemoveItems_Click()
VBFlexGrid1.ComboItems = vbNullString
cmbCombo1.Clear
cmbComboBoxW1.Clear
End Sub
-
Feb 16th, 2024, 08:58 AM
#1269
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I don't understand really how it works, but sometimes I can see the drop-down list in both comboboxes and sometimes I can't...
-
Feb 16th, 2024, 09:02 AM
#1270
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Here I use the RemoveItem instead of Clear.
Code:
Private Sub cmdAddItems_Click()
With VBFlexGrid1
.CellComboCue = FlexComboCueDropDown
.ComboMode = FlexComboModeDropDown
.ComboItems = "Arnold|Bob|Charlie|David"
End With
With cmbCombo1 ' VB ComboBox, Style = 2 (Dropdown list)
.AddItem "Arnold"
End With
With cmbComboBoxW1 ' CCR ComboBox, Style = 2 (Dropdown list)
.AddItem "Arnold"
End With
End Sub
Private Sub cmdRemoveItems_Click()
VBFlexGrid1.ComboItems = vbNullString
cmbCombo1.RemoveItem 0
cmbComboBoxW1.RemoveItem 0
End Sub
-
Feb 16th, 2024, 09:26 AM
#1271
Addicted Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Set CellChecked to FlexTextAsCheckBox.
Process the EditKeyPress event and set KeyChar to 0 fur unwanted chars.
Code:
Private Sub Form_Load()
Set Me.VBFlexGrid1.DataSource = GetRs("SELECT * FROM tblDataTaye;")
With Me.VBFlexGrid1
.CellChecked = FlexTextAsCheckBox
End With
Set Me.VSFlexGrid1.DataSource = GetRs("SELECT * FROM tblDataTaye;")
End Sub

Hello Krool! I've set the ". CellChecked = FlexTextAsCheckBox", but you can't make the column of a Boolean field appear as the corresponding checkbox. The above is my code, please guide me on how to modify the code so that these Boolean fields (Boolean, Enabled, Allow, Delete) can be displayed according to the corresponding checkboxes of the field values. If you're convenient, add a demonstration of how to use the Boolean field display checkbox to this VBFlexGridDemo. Thank you very much!
VSFGTest1.1.zip
Last edited by smileyoufu; Feb 16th, 2024 at 09:30 AM.
-
Feb 16th, 2024, 10:58 AM
#1272
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by smileyoufu
Code:
Private Sub Form_Load()
Set Me.VBFlexGrid1.DataSource = GetRs("SELECT * FROM tblDataTaye;")
With Me.VBFlexGrid1
.CellChecked = FlexTextAsCheckBox
End With
Set Me.VSFlexGrid1.DataSource = GetRs("SELECT * FROM tblDataTaye;")
End Sub
Hello Krool! I've set the ". CellChecked = FlexTextAsCheckBox", but you can't make the column of a Boolean field appear as the corresponding checkbox. The above is my code, please guide me on how to modify the code so that these Boolean fields (Boolean, Enabled, Allow, Delete) can be displayed according to the corresponding checkboxes of the field values. If you're convenient, add a demonstration of how to use the Boolean field display checkbox to this VBFlexGridDemo. Thank you very much!
VSFGTest1.1.zip
Code:
Private Sub Form_Load()
Set Me.VBFlexGrid1.DataSource = GetRs("SELECT * FROM tblDataTaye;")
With Me.VBFlexGrid1
.FillStyle = FlexFillStyleRepeat
.Cell(FlexCellChecked, .FixedRows, 2, .Rows - 1, 5) = FlexTextAsCheckBox
End With
Set Me.VSFlexGrid1.DataSource = GetRs("SELECT * FROM tblDataTaye;")
End Sub
Last edited by Nouyana; Feb 16th, 2024 at 11:35 AM.
Reason: fixing the error in code
-
Feb 18th, 2024, 05:10 AM
#1273
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Nouyana,
I can't replicate the "no drop-down list" thing. However, I fixed now a bug that the drop-down list is not clickable anymore when it's empty. So that the list will not be closed anymore and mouse capture is released.
The same behavior as a ComboBox..
-
Feb 18th, 2024, 08:56 AM
#1274
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
I fixed now a bug that the drop-down list is not clickable anymore when it's empty.
Looks better. Thank you, Krool.
-
Feb 18th, 2024, 09:34 AM
#1275
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Update released.
Included the DragRow/DragCol function used to rearrange rows/cols by dragging the specified row/col with the mouse to a new position.
To note is that this is NOT an OLE drag/drop operation and the function will enter a modal message loop to just return the new moved position. (like vsFlexGrid)
The demo project is updated to use this new internal function.
Example code:
Code:
Private Sub VBFlexGrid1_BeforeMouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single, Cancel As Boolean)
With VBFlexGrid1
If Button = vbLeftButton And (Shift And vbAltMask) = vbAltMask Then
.HitTest X, Y
If .HitResult = FlexHitResultCell Then
If .HitCol < .FixedCols And .HitRow >= .FixedRows Then
VBFlexGrid1.RowPosition(.HitRow) = VBFlexGrid1.DragRow(.HitRow)
Cancel = True
ElseIf .HitCol >= .FixedCols And .HitRow < .FixedRows Then
VBFlexGrid1.ColPosition(.HitCol) = VBFlexGrid1.DragCol(.HitCol)
Cancel = True
End If
End If
End If
End With
End Sub
The OCX VBFLXGRD17 was also updated. The internal type lib version is now 1.6.
Code:
Object={2DA70529-3366-414A-B408-46083BCD481B}#1.6#0; VBFLXGRD17.OCX
-
Feb 18th, 2024, 11:52 AM
#1276
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Included the DragRow/DragCol function
Great job, Krool! You make things easier!
I don't know why, but I can't unzip your new attachments. did you change the archiver? I use "7-zip" 24.01 (2024-01-31). I had to download files from Github.
Maybe something is wrong with this forum. The "Reply with quote" button doesn't work for me today too...
-
Feb 19th, 2024, 01:24 AM
#1277
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
That seems to be a forum issue about the invalid zip file..
EDIT: zip file working again
Last edited by Krool; Feb 21st, 2024 at 02:00 PM.
-
Feb 19th, 2024, 04:07 AM
#1278
Banned
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Krool,
One question, with the combbox insert in a cell, dropdown is ok, leave the cell, it seems the combbox item already transfered to the cell, but when I use msgbox to read the cell text, it shows nothing! any idea or method about it?
Thanks.
John
PS: Sorry I use a timer to read the cell text and the above issue occured. Solved the problem.
Last edited by JT870; Feb 19th, 2024 at 05:14 AM.
-
Feb 19th, 2024, 06:43 AM
#1279
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
JT870,
please provide some code. Otherwise it's hard to imagine ..
Maybe you MsgBox the .EditText which of course is reset once editing is finished.
-
Feb 26th, 2024, 02:40 PM
#1280
Addicted Member
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
|