Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
QuestionGet highlighted text from any window with special shortcut Pin
mgiaco824-Jun-07 10:34
mgiaco824-Jun-07 10:34 
AnswerRe: Get highlighted text from any window with special shortcut Pin
mgiaco825-Jun-07 2:20
mgiaco825-Jun-07 2:20 
Question[Message Deleted] Pin
R_L_H4-Jun-07 10:27
R_L_H4-Jun-07 10:27 
AnswerRe: How Do You Disable All Click Events For A .Net Control? Pin
Dave Kreskowiak4-Jun-07 10:42
mveDave Kreskowiak4-Jun-07 10:42 
AnswerRe: How Do You Disable All Click Events For A .Net Control? Pin
Ian Shlasko4-Jun-07 10:49
Ian Shlasko4-Jun-07 10:49 
General[Message Deleted] Pin
R_L_H4-Jun-07 10:53
R_L_H4-Jun-07 10:53 
GeneralRe: How Do You Disable All Click Events For A .Net Control? Pin
Ian Shlasko4-Jun-07 12:00
Ian Shlasko4-Jun-07 12:00 
GeneralRe: How Do You Disable All Click Events For A .Net Control? Pin
Dave Kreskowiak4-Jun-07 14:00
mveDave Kreskowiak4-Jun-07 14:00 
I checked out that link. If I understand what you're getting at, you're capturing the window message for button down and stuff, essentially just intercepting the messages and stopping them from being dispatched.

We've both done the same thing but from different ends. Both methods havae their pros and cons.

First, in my method, I'm not stopping the mouse message, just stopping the event from firing once the message is dispatched. The upside is it's very little code, being done in about a minute. The down side is that if you have multiple controls, you'd have to do this for each control. But, again on the upside, this makes the controls reusable in other applications without any kind of outside support, like another panel.

In your method, you can use any controls you want, making the method quite flexible without having to modify any controls, save the panel control! The downside is that it's an all-or-nothing solution. You cannot turn off the click, or other events, for just some of the controls and leave it up for the rest. This could cause a problem if different control types have varying requirements for use of the mouse, or other events.

The other downside to this method is embedding a child modifiedpanel into a larger modifiedpanel. If the larger container panel is "ReadOnly", the mous messages won't get down to the child modifiedpanel that you might want to NOT be "ReadOnly". The opposite situation does work though. The parent panel can be Read/Write while the child panel can be ReadOnly.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: How Do You Disable All Click Events For A .Net Control? Pin
Ian Shlasko5-Jun-07 2:52
Ian Shlasko5-Jun-07 2:52 
Questionhow to check free space on disk using FTP client? Pin
wojti4-Jun-07 9:58
wojti4-Jun-07 9:58 
AnswerRe: how to check free space on disk using FTP client? Pin
Dave Kreskowiak4-Jun-07 10:32
mveDave Kreskowiak4-Jun-07 10:32 
Questionchange button shape Pin
ABBASI_RA4-Jun-07 9:03
ABBASI_RA4-Jun-07 9:03 
AnswerRe: change button shape Pin
Tarakeshwar Reddy4-Jun-07 9:07
professionalTarakeshwar Reddy4-Jun-07 9:07 
GeneralRe: change button shape Pin
ABBASI_RA4-Jun-07 9:20
ABBASI_RA4-Jun-07 9:20 
QuestionHow to find name of a library? (beginner) Pin
Christian Bailey4-Jun-07 9:03
Christian Bailey4-Jun-07 9:03 
AnswerRe: How to find name of a library? (beginner) Pin
SimulationofSai4-Jun-07 22:31
SimulationofSai4-Jun-07 22:31 
Questionselected column header datagridview Pin
FernandoMartin4-Jun-07 9:02
FernandoMartin4-Jun-07 9:02 
QuestionEmail merg Pin
merwa4-Jun-07 8:49
merwa4-Jun-07 8:49 
AnswerRe: Email merg Pin
Muammar©4-Jun-07 11:05
Muammar©4-Jun-07 11:05 
Questionget current session ID Pin
crash8934-Jun-07 8:00
crash8934-Jun-07 8:00 
AnswerRe: get current session ID Pin
Tarakeshwar Reddy4-Jun-07 8:51
professionalTarakeshwar Reddy4-Jun-07 8:51 
GeneralRe: get current session ID Pin
crash8934-Jun-07 9:06
crash8934-Jun-07 9:06 
GeneralRe: get current session ID Pin
Giorgi Dalakishvili4-Jun-07 9:20
mentorGiorgi Dalakishvili4-Jun-07 9:20 
GeneralRe: get current session ID Pin
crash8934-Jun-07 9:22
crash8934-Jun-07 9:22 
GeneralRe: get current session ID Pin
crash8934-Jun-07 9:22
crash8934-Jun-07 9:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.