473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 3582
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.