|
-
Jul 12th, 2017, 08:10 PM
#1
Thread Starter
PowerPoster
Is there a property to make the checkboxes on a checked listbox larger?
Hi there folks! I am new to checked listboxes, and recently I made the text font larger on the listbox, but is there a property to make the checkboxes larger to go with it?
Thanks a lot!
-
Jul 12th, 2017, 09:59 PM
#2
New Member
Re: Is there a property to make the checkboxes on a checked listbox larger?
 Originally Posted by Justin M
Hi there folks! I am new to checked listboxes, and recently I made the text font larger on the listbox, but is there a property to make the checkboxes larger to go with it?
Thanks a lot!
hi there,
http://database.ittoolbox.com/groups...-bigger-399496
try from this link. It works for me on vb6
-
Jul 12th, 2017, 10:21 PM
#3
Fanatic Member
Re: Is there a property to make the checkboxes on a checked listbox larger?
No, there is no such property. You will probably have to make your own custom listbox user control
-
Jul 12th, 2017, 11:23 PM
#4
Re: Is there a property to make the checkboxes on a checked listbox larger?
This may be of interest to you -
http://www.planet-source-code.com/vb...62733&lngWId=1
Not sure if checkboxes get bigger with the font increase, but it may still be better than the intrinsic Listbox
HTH,
Rob
-
Jul 12th, 2017, 11:50 PM
#5
Re: Is there a property to make the checkboxes on a checked listbox larger?
 Originally Posted by Justin M
Hi there folks! I am new to checked listboxes, and recently I made the text font larger on the listbox, but is there a property to make the checkboxes larger to go with it?
The answer to "making it bigger" (stop giggling) is not larger fonts, etc. but instead raising the DPI setting on the system (or monitor on current Windows versions supporting per-monitor DPI). High DPI poses its own challenges of course but rejecting that as an answer is just trying to buck the tide.
What you have is a situation where the monitor DPI has increased, but to make legacy coding techniques continue working (sort of) you are telling Windows to keep pretending the monitor has 96 pixels per inch. The result is that everything keeps on "getting smaller" every time you move to a denser monitor.
-
Jul 13th, 2017, 01:39 AM
#6
Re: Is there a property to make the checkboxes on a checked listbox larger?
If you substitute a ListView for the ListBox (will look the same), you can make them bigger

See this project.
All I did for the proof of concept here, Module1 contains the function 'InitCheckHIML', I simply changed all the 16s to 32s for the ListView (the TreeView I think you'd have to make the font bigger first because they got squished when I tried).
Code:
Public Sub InitCheckHIML()
Dim hIco As Long
Dim lPos As Long
himlCheck = ImageList_Create(32, 32, ILC_COLOR32 Or ILC_ORIGINALSIZE, 1, 1)
ImageList_SetIconSize himlCheck, 32, 32
hIco = ResIconTohIcon("CHK_STD_UNCHKD", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_STD_CHKD", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_STD_DIS", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_EXT_PAR", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_EXT_EXP", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_EXT_DEF", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_EXT_X", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_CST_UNCHKD", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
hIco = ResIconTohIcon("CHK_CST_CHKD", 32, 32)
Call ImageList_AddIcon(himlCheck, hIco)
Call DestroyIcon(hIco)
'---snip---
Last edited by fafalone; Jul 13th, 2017 at 01:48 AM.
-
Jul 13th, 2017, 03:23 AM
#7
Frenzied Member
Re: Is there a property to make the checkboxes on a checked listbox larger?
 Originally Posted by Justin M
Hi there folks! I am new to checked listboxes, and recently I made the text font larger on the listbox, but is there a property to make the checkboxes larger to go with it?
Thanks a lot!
The owner-drawn ListBox can do a custom appearance.
-
Jul 13th, 2017, 04:37 AM
#8
Re: Is there a property to make the checkboxes on a checked listbox larger?
Ok so I tested it with the font size changed too, it worked out even better. For the finishing touch I also assigned 32x32 imagelist to the regular icons. To compare, the default sizes can be seen on the TreeView on the right, which wasn't touched.
This is with 18-point Tahoma:

Do note though if what you're doing is adjusting for a higher DPI, listen to dilettante, you shouldn't be doing that by changing the font points.
-
Jul 13th, 2017, 06:12 AM
#9
Re: Is there a property to make the checkboxes on a checked listbox larger?
Hi
you could use a Flexgrid..
place on a Form.. 1xFlexgrid, 1xListbox, 1xCommandbutton
Code:
'set check or remove Check Cell
Public Property Let FlexCellChecked(Flex As MSFlexGrid, Row As Long, _
Col As Long, vData As Boolean)
Dim SaveRow As Long, SaveCol As Long
With Flex
.Redraw = False
'save Position
SaveRow = .Row
SaveCol = .Col
.Row = Row
.Col = .Col
If vData Then
'True
.Text = "a"
Else
'False
.Text = vbNullString
End If
'save again
.Row = SaveRow
.Col = SaveCol
.Redraw = True
End With
End Property
'True/False Cell Checked
Public Property Get FlexCellChecked(Flex As MSFlexGrid, Row As Long, _
Col As Long) As Boolean
Dim SaveRow As Long, SaveCol As Long
With Flex
.Redraw = False
SaveRow = .Row
SaveCol = .Col
.Row = Row
.Col = .Col
'Value checked ?
FlexCellChecked = (.Text = "a")
.Row = SaveRow
.Col = SaveCol
.Redraw = True
End With
End Property
Private Sub Command1_Click()
Dim i As Long
List1.Clear
With MSFlexGrid1
For i = .FixedRows To .Rows - 1
.Row = i
List1.AddItem "Row " & i & " Checked: " & FlexCellChecked(MSFlexGrid1, i, 1)
Next
End With
End Sub
Private Sub Form_Load()
Dim i As Long
With MSFlexGrid1
.Rows = 5
.Cols = 5
.Col = 1
.ColAlignment(1) = flexAlignCenterCenter
.ColWidth(1) = 450
For i = 0 To .Rows - 1
.Row = i
.CellFontName = "Marlett"
.CellFontSize = 20 '<-- to large ?
If i = 0 Then
.Text = "a"
End If
Next
End With
End Sub
Private Sub MSFlexGrid1_Click()
With MSFlexGrid1
If .Col = 1 Then
FlexCellChecked(MSFlexGrid1, .Row, .Col) = _
Not FlexCellChecked(MSFlexGrid1, .Row, .Col)
End If
End With
End Sub
regards
Chris
-
Aug 8th, 2017, 12:29 AM
#10
Addicted Member
Re: Is there a property to make the checkboxes on a checked listbox larger?
I think the question was about this:
-
Aug 8th, 2017, 05:15 AM
#11
Re: Is there a property to make the checkboxes on a checked listbox larger?
Never thought about such possibility.
But I could implement such a 'StateImageSize' property to my ListBoxW control.
So such a property would then apply to a ListBoxW control which 'Style' property is set to '1 - Checkbox' or '2 - Option'.
-
Aug 8th, 2017, 08:59 AM
#12
Re: Is there a property to make the checkboxes on a checked listbox larger?
@Krool---are you referring to Chris, or Inside?
@Inside---what control is that? Code? Properties?
-
Aug 8th, 2017, 10:43 AM
#13
Re: Is there a property to make the checkboxes on a checked listbox larger?
 Originally Posted by SamOscarBrown
@Krool---are you referring to Chris, or Inside?
@Inside---what control is that? Code? Properties?
referring to this topic in general.
I think Inside made this up (image) to illustrate what this topic is all about.
-
Aug 8th, 2017, 01:37 PM
#14
-
Aug 10th, 2017, 12:28 AM
#15
Addicted Member
Re: Is there a property to make the checkboxes on a checked listbox larger?
 Originally Posted by Krool
referring to this topic in general.
I think Inside made this up (image) to illustrate what this topic is all about.
Yes. Just a quick drawn picture with a few labels.
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
|