472,981 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 software developers and data experts.

Disable Mouse Click Event

Hi,

i am new to C#,

i have a multiselection treeview, where if i select a nodes with ctrl and shift corresponding nodes will be copied to another treenode,

i want to unselect the childnode selection with ctrl and shift if parent node is selected.

i think of disablin the mouse click event inside that treenode if parent node is selected?
Expand|Select|Wrap|Line Numbers
  1. private void treeViewMS1_AfterSelect(object sender, TreeViewEventArgs e)
  2. {
  3.     MyKeyEvent kEv = new MyKeyEvent();
  4.     bool kControl2 = (ModifierKeys == Keys.Control);
  5.     bool kShift2 = (ModifierKeys == Keys.Shift);
  6.     bool mClick = (MouseButtons == MouseButtons.Left);
  7.     // bool parent =IsP
  8.     if (e.Node.Text == "WeldDataFile")
  9.     {
  10.         if ((kControl2) && (mClick))
  11.         {
  12.             // OnKeyAction(this, kEv); 
  13.             //Here i have to disable mouse event till i copy that selected node to another treeview
  14.         }
  15.         else if ((kShift2) && (mClick))
  16.         {
  17.             //OnKeyAction(this, kEv);
  18.             //Here i have to disable mouse event till i copy that selected node to another treeview
  19.         }
  20.     }
  21. }
  22.  
Can anybody plz help me in this regards, its urgent
Feb 29 '08 #1
2 3551
SammyB
807 Expert 512MB
The easy way is to have a class-level variable that is set to true while you copy the node. Then you just check that variable in other events. The fancy way is to filter out the mouse messages before they reach the controls. If you google for IMessageFilter and mouse, you will find code examples. HTH --Sam
Feb 29 '08 #2
The easy way is to have a class-level variable that is set to true while you copy the node. Then you just check that variable in other events. The fancy way is to filter out the mouse messages before they reach the controls. If you google for IMessageFilter and mouse, you will find code examples. HTH --Sam

i used IMessage filter interface but mouse is disabled in the whole application, but i want it only inside treeview
how come it is possible?
Mar 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: yair | last post by:
hey all i have a page with a table, and when the user doubleclicks a row in it, a window is opened. The problem is, if he doubleclicked a text in the row, it's becoming selected. what i want is...
6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
9
by: Armando | last post by:
I have an app (A2000) where I am letting the user move an object on the screen. I use the OnClick for a command button event to modify the object's Top (or Left) properties, but you can only click...
2
by: bartlomiej.szafraniec | last post by:
Hi! I'm trying to implement custom button. But I don't want to extend Button class. I want to extend Control class. I want to implement Enable disable functionality. But unfortunatly when...
4
by: Seen | last post by:
This has probably been covered before but I can't seem to find it. I want to disable the user from using the right mouse button that brings up a windown menu of options. How's it done?????
1
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on...
8
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? -----------------------------------------------------------------------...
1
by: selvakumari | last post by:
Hi, i am new to C#, i have a multiselection treeview, where if i select a nodes with ctrl and shift corresponding nodes will be copied to another treenode, i want to unselect the childnode...
3
by: nagmvs | last post by:
Hai guys, I want the the code to disable Left Mouse button with out Alert message. Below code i am having <!-- This code is for disableing left click--> <script language="javascript">...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.