Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 04-20-2017, 03:30 AM   #1
wisekat
Newly Registered User
 
Join Date: Feb 2017
Posts: 18
Thanks: 2
Thanked 1 Time in 1 Post
wisekat is on a distinguished road
Increase focus rectangle thickness for Ultra-HD screens

I am using an MS Access 2016 database on an Ultra-HD screen with 282ppi. When I move the input focus to a button using the TAB key, it's very hard to recognize the focused button as the focus rectange is just a 1-pixel dotted line. Perhaps, you'll notice the focus rectangle on the first button 'Name' on the picture below easy on an ordinary 96ppi screen, but it's very hard to see on a high-resolution screen:

Is there a way to increase the thickness of the focus rectangle line in MS Access? Perhaps, you can also suggest another solution how to make an active button more noticeable for the user.

wisekat is offline   Reply With Quote
Old 04-20-2017, 03:49 AM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,439
Thanks: 40
Thanked 3,368 Times in 3,263 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Increase focus rectangle thickness for Ultra-HD screens

you can use the onenter/exit or ongotfocus/lostfocus events to change what the control looks like

create a new module and enter the following

Code:
function changeborder()
    screen.activecontrol.borderwidth=5 '- modify to what is OK for you
end function

function restoreborder()
    screen.activecontrol.borderwidth=1
end function
then in form design, select all the controls you want to apply this effect and on the propertysheet events tab put

=changeborder() against the on enter event and
=restoreborder() against the on exit event
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
wisekat (04-20-2017)
Old 04-20-2017, 04:10 AM   #3
wisekat
Newly Registered User
 
Join Date: Feb 2017
Posts: 18
Thanks: 2
Thanked 1 Time in 1 Post
wisekat is on a distinguished road
Re: Increase focus rectangle thickness for Ultra-HD screens

Yes, I know that I can do something with my buttons when they get/lose input focus. I already tried changing the background color in the GotFocus/LostFocus event handlers. Unfortunately, that's a bad idea as we need to duplicate this code this for every (!) button on a form. I am still hoping there is a more elegant solution...

wisekat is offline   Reply With Quote
Old 04-20-2017, 04:52 AM   #4
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,439
Thanks: 40
Thanked 3,368 Times in 3,263 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Increase focus rectangle thickness for Ultra-HD screens

read my post again - there is no code in the form as far as this is concerned
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 04-20-2017, 05:15 AM   #5
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,439
Thanks: 40
Thanked 3,368 Times in 3,263 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Increase focus rectangle thickness for Ultra-HD screens

if you don't want to use code, use conditional formatting
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 04-20-2017, 06:27 AM   #6
missinglinq
AWF VIP
 
missinglinq's Avatar
 
Join Date: Jun 2003
Location: Richmond (Virginia that is!)
Posts: 6,214
Thanks: 11
Thanked 691 Times in 648 Posts
missinglinq is a glorious beacon of light missinglinq is a glorious beacon of light missinglinq is a glorious beacon of light missinglinq is a glorious beacon of light missinglinq is a glorious beacon of light
Re: Increase focus rectangle thickness for Ultra-HD screens

Quote:
Originally Posted by CJ_London View Post
if you don't want to use code, use conditional formatting
You can't use Conditional Formatting on Command Buttons, but you could use Textboxes, tweaked to look like Buttons, and then use their OnClick events for their function.

Linq ;0)>
__________________
The Devil's in the Details!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


(All code solutions tested in Access 2003/2007, before posting, unless otherwise noted.)
missinglinq is offline   Reply With Quote
Old 04-20-2017, 08:31 AM   #7
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,439
Thanks: 40
Thanked 3,368 Times in 3,263 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Increase focus rectangle thickness for Ultra-HD screens

hadn't noticed they were buttons - so scrap the conditional formatting suggestion

__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 04-20-2017, 11:07 PM   #8
wisekat
Newly Registered User
 
Join Date: Feb 2017
Posts: 18
Thanks: 2
Thanked 1 Time in 1 Post
wisekat is on a distinguished road
Re: Increase focus rectangle thickness for Ultra-HD screens

Quote:
Originally Posted by CJ_London View Post
read my post again - there is no code in the form as far as this is concerned
Yes, you are almost right as we still need to write some code and attach it manually to the required controls - though we do it with the Property Sheet.

But thank you for suggesting this alternative way of doing what I need. At least, the code module will be less cluttered with typical duplicated event handlers.

The problem of both approaches is that we need to remember to do the same thing for all new controls on our forms. It would be nice to have a global setting for all forms...
wisekat is offline   Reply With Quote
Old 04-21-2017, 12:02 AM   #9
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,439
Thanks: 40
Thanked 3,368 Times in 3,263 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Increase focus rectangle thickness for Ultra-HD screens

well you can automate it on opening the form

in the module put

Code:
 
function setForm(frm as form)
dim ctrl as control
 
for each ctrl in frm.controls
    on error resume next ' in case ctrl does not have these event properties
    ctrl.onenter="=changeborder()"
    ctrl.onexit="=restoreborder()"
next ctrl
end function
and in the form open event put

=setForm([Form])

You can also create a form template. In access, go to help and search for 'Specify a new template for forms and reports'.

__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
wisekat (04-21-2017)
Reply

Tags
button , focus rectangle , high-resolution screen

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi! Ultra Newbie from Canada. PScotty Introduce Yourself 1 04-11-2012 03:25 PM
Line Thickness in Report AN60 Reports 2 02-25-2008 01:22 AM
How do I change line thickness of columns greaseman Reports 1 04-18-2006 08:57 AM
Adjusting Vertical Line thickness Argonak Reports 2 06-08-2005 05:09 AM
ultra noob in need of ultra help :) b0rna General 1 06-06-2005 07:12 PM




All times are GMT -8. The time now is 02:40 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World