Solved

How can I disable click through on my transparent form?

Posted on 2006-11-18
4
633 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 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