Solved Modal Dialogs with Transparent Backgrounds

Thank you. Just what I was looking for.
 
I can't look at the downloaded file currently as I'm on a tablet with 64-bit Access.
However, having skim read Cypris' article, the effect is indeed very similar to the dim background example in my Attention Seek example database mentioned as @moke123
The code required is much simpler as well 😏
The app also includes lots of other methods for getting users' attention
Hope that helps
 
I can't look at the downloaded file currently as I'm on a tablet with 64-bit Access.
However, having skim read Cypris' article, the effect is indeed very similar to the dim background example in my Attention Seek example database mentioned as @moke123
The code required is much simpler as well 😏
The app also includes lots of other methods for getting users' attention
Hope that helps
I downloaded your database as well, so I'll try that approach.
 
@isladogs
How would I modify your code to point to a form, in this case "Form1", in order to put the Dim Background behind the form want to focus attention on?

Something like this?
Code:
Private Sub cmd6_Click()
    ResetDisplay
'dim background
    Form_frmDimmer.DoDim "form1"
'restore background
    Form_frmDimmer.UnDim
End Sub

I can't look at the downloaded file currently as I'm on a tablet with 64-bit Access.
However, having skim read Cypris' article, the effect is indeed very similar to the dim background example in my Attention Seek example database mentioned as @moke123
The code required is much simpler as well 😏
The app also includes lots of other methods for getting users' attention
Hope that helps
 
Hi
You would put the code in the form itself - That is the form you want to 'highlight' when the rest of the display is dimmed
3 events are needed:
1. Form_Load event - loads frmDimmer to dim background after a short time interval e.g. 20 milliseconds
2. Form_Timer event - runs once
3, Form_Unload - VERY IMPORTANT - needed to restore normal functionality when form is closed.
If you omit this you will be unable to control your computer !

SQL:
Private Sub Form_Load()
     Form_frmDimmer.DoDim Me
     Me.TimerInterval = 20
End Sub

Private Sub Form_Timer()
    Me.Show         'Show the form
    Me.OnTimer = "" 'Disable the timer from running again
    'Me.TimerInterval=0 'alternative method of disabling timer from running again
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Form_frmDimmer.UnDim
End Sub

The attached DEMO shows this in use.
You will need modMetrics to use the code as shown
NOTE: it also includes modResizeForm which is used for automatic form resizing - not required for dimming background feature

Hope that helps
 

Attachments

@isladogs What do you mean, unable to control my computer? Just that Access program? Would Ctrl, Alt, Delete work?
 
Last edited:
3, Form_Unload - VERY IMPORTANT - needed to restore normal functionality when form is closed.
If you omit this you will be unable to control your computer !
I'm just wondering if you learned that the easy way or the hard way. :unsure:
 
@isladogs

I'm getting a compile error on the me.show line in your code.

I imported your modMetrics and frmDimmer
I put the below code on the popup form I want to have the transparent background behind.

Behavior:
When the form opened, the background color did show up and then it errored.
When I stopped the vba code and closed the form, the background showed one more time before closing.

Hi
You would put the code in the form itself - That is the form you want to 'highlight' when the rest of the display is dimmed
3 events are needed:
1. Form_Load event - loads frmDimmer to dim background after a short time interval e.g. 20 milliseconds
2. Form_Timer event - runs once
3, Form_Unload - VERY IMPORTANT - needed to restore normal functionality when form is closed.
If you omit this you will be unable to control your computer !

SQL:
Private Sub Form_Load()
     Form_frmDimmer.DoDim Me
     Me.TimerInterval = 20
End Sub

Private Sub Form_Timer()
    Me.Show         'Show the form
    Me.OnTimer = "" 'Disable the timer from running again
    'Me.TimerInterval=0 'alternative method of disabling timer from running again
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Form_frmDimmer.UnDim
End Sub

The attached DEMO shows this in use.
You will need modMetrics to use the code as shown
NOTE: it also includes modResizeForm which is used for automatic form resizing - not required for dimming background feature

Hope that helps
 
I'm just wondering if you learned that the easy way or the hard way. :unsure:
As you'd expect …. the hard way …. and repeated it today testing the example on a tablet where I had trouble with the three fingered salute.
Had to switch off and on again!

@dgreen
I took the items from one of my commercial apps where its been in use for over 10 years.
I've also tested this example in A2010 32-bit and A365 64-bit.
Both versions compile and work successfully for me.
Did my app work for you? If not, I suggest you download a fresh copy and save it to a trusted folder.
Otherwise the issue is a problem when you imported the modules to your own app.
That often indicates duplicated module code.

Alternatively, you haven't imported the Show subprocedure to your form
 
Where is the show subprocedure at? I'm missing something in your instructions.

As you'd expect …. the hard way …. and repeated it today testing the example on a tablet where I had trouble with the three fingered salute.
Had to switch off and on again!

@dgreen
I took the items from one of my commercial apps where its been in use for over 10 years.
I've also tested this example in A2010 32-bit and A365 64-bit.
Both versions compile and work successfully for me.
Did my app work for you? If not, I suggest you download a fresh copy and save it to a trusted folder.
Otherwise the issue is a problem when you imported the modules to your own app.
That often indicates duplicated module code.

Alternatively, you haven't imported the Show subprocedure to your form
 
Sorry its another event in my form frmWhatsNew that you also need.
Its very simple

Code:
Public Sub Show()
    Me.Visible=True
End Sub
 

Users who are viewing this thread

Back
Top Bottom