x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

How can I best do checklists with strikethrough text? (eVB)

I dunk for bananas Page Icon Posted 2024-05-03 7:52 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
708
Location:
Europe
Status:
I'm working on a checklist-type application and I'm trying to add functionality that lets the user add entries to a list, and then cross them out by clicking on individual entries.
This doesn't seem possible with a ListView control, since there's no way to make only the text of a singular list entry strikethrough - so I tried using a grid control, but that is unfortunately extremely cumbersome to use, as there doesn't seem to be a way to change the default font or cell size, so everything is extremely tiny. Anyone have any ideas perhaps?
 Top of the page
stingraze Page Icon Posted 2024-05-04 11:44 AM
#
Avatar image of stingraze
Subscribers
H/PC Vanguard

Posts:
3,692
Location:
Japan
Status:
I don’t have a working eVB dev environment right now so I can’t test it, but here’s a way to do in VBA. The source code was simple, so worth taking a look.

Const conTransparent = 0 'Should be a Fixed Width Font Me![txtText].FontName = "Courier New" Me![txtText].FontSize = 12 Me![txtText] = "Your text" Me![txtOverlay].FontName = "Courier New" Me![txtOverlay].FontSize = 12 Me![txtOverlay].BackStyle = conTransparent Me![txtOverlay] = String(Len(Me![txtText]), "-"


https://stackoverflow.com/questions/43581314/how-to-strikethrough-text-in-vba-programmatically

Original code from:
https://bytes.com/topic/access/answers/722250-strikethrough-text

Edited by stingraze 2024-05-04 11:44 AM
 Top of the page
WinCEDev Page Icon Posted 2024-05-05 8:10 PM
#
Avatar image of WinCEDev
Factorite (Senior)

Posts:
79
Location:
Europe
Status:
Could you show us a screenshot of the issue with the Grid control? I feel like that might be fixable.

I think this will be tricky using other controls because you would need to owner-draw them (which requires subclassing).
The default CheckBox control does let you apply the strikeout style to the text, so you may be able to build your own list using CheckBox controls and VScrollBar.
 Top of the page
I dunk for bananas Page Icon Posted 2024-05-06 10:49 AM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
708
Location:
Europe
Status:
Thank you two for your replies! I didn't consider the checkbox method, that's a good idea too!
I managed to figure out the grid control, I just have to select the most recently added cell and set its style properties each time one is added, rather than having a default font style for all cells, which is a little annoying, but fine! And clicking leading to a strikethrough works too now
Now I just need to figure out the best way to implement saving - I'm trying to use "put" since I haven't gotten to use it yet

Edited by I dunk for bananas 2024-05-06 11:35 AM
 Top of the page
Jump to forum:
Seconds to generate: 0.171 - Cached queries : 59 - Executed queries : 11