Solved

How can I disable click through on my transparent form?

Posted on 2006-11-18
4
632 Views
Last Modified: 2008-02-01
I'm using this procure to update my form when the user changes the slider. If they enable click-through by checking the checkbox, then click-through becomes active after changing the slider. The problem is that I can't find a way to disable click-through.

    Dim lOldStyle As Long
    Dim bTrans As Byte

    bTrans = sliderTrans.Value
   
    lOldStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)

    If Me.chkClickThrough = False Then
        SetWindowLong Me.hwnd, GWL_EXSTYLE, lOldStyle Or WS_EX_LAYERED
    Else
        SetWindowLong Me.hwnd, GWL_EXSTYLE, lOldStyle Or WS_EX_LAYERED Or WS_EX_TRANSPARENT 'Click Through
    End If
   
    SetLayeredWindowAttributes Me.hwnd, 0, bTrans, LWA_ALPHA






If the user users Alt+Tab they can set focus on my application / form. Then if they press F10, it will uncheck click-through and run this code that doesn't work:


    Case vbKeyF10
            Me.chkClickThrough = False
            Dim lOldStyle As Long
            Dim bTrans As Byte
            bTrans = sliderTrans.Value
            lOldStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
            SetWindowLong Me.hwnd, GWL_EXSTYLE, lOldStyle Or WS_EX_LAYERED
   
            SetLayeredWindowAttributes Me.hwnd, 0, bTrans, LWA_ALPHA
0
Comment
Question by:HKComputer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 14

Expert Comment

by:Glenn_Moore
ID: 17972100
If you look at your form in the design view and click inside the form, one option is Tab Order, you can remove access to any of the fields you choose.
0
 
LVL 4

Author Comment

by:HKComputer
ID: 17972109
I fixed the problem already. Logic bug:

Case vbKeyF10
  Me.chkClickThrough = False
  Dim lOldStyle As Long
  Dim bTrans As Byte
  bTrans = sliderTrans.Value
  lOldStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
  SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_LAYERED   '<----Removed lOldStyle
   
  SetLayeredWindowAttributes Me.hwnd, 0, bTrans, LWA_ALPHA
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18400834
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question