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!
Re: Is there a property to make the checkboxes on a checked listbox larger?
Quote:
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
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
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
Re: Is there a property to make the checkboxes on a checked listbox larger?
Quote:
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.
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
http://i.imgur.com/rlhnZcz.jpg
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---
Re: Is there a property to make the checkboxes on a checked listbox larger?
Quote:
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.
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:
http://i.imgur.com/PKuD5y2.jpg
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.
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
1 Attachment(s)
Re: Is there a property to make the checkboxes on a checked listbox larger?
I think the question was about this:
Attachment 150397
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'.
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?
Re: Is there a property to make the checkboxes on a checked listbox larger?
Quote:
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.
3 Attachment(s)
Re: Is there a property to make the checkboxes on a checked listbox larger?
AFAIK, if you are rendering with Themes using UxTheme DrawThemeBackground then Check and Option images are locked to 13 pixels.
Even if you were to grab the 13 pixel image and stretch it, the quality is not that good.
To get around this you can put larger high quality PNG Check and Option image strips containing all states in a resource file and stretch/shrink them in OwnerDraw controls.
Here are some high quality Check and Option image strips that you can use to implement this:
Attachment 150415
Attachment 150417
Re: Is there a property to make the checkboxes on a checked listbox larger?
Quote:
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.