|
Can you be more precise with your question?
Do you mean you want to perform a double click just with a single click on a particular control?
You can always change the function name in the delegate for single click event declaration in the "Form Design code" to reflect the double click function.
Hope this is what you were looking for...
Yasir S. Memon,
ysm@aqualyzer.com
Chief System Architect,
Aqualyzer
|
|
|
|
|
Yesir;
Thanks for the reply.
I don't quite understand what you are ssying. Here is what I got:
this.gridPredictorCases.ClickEvent += new System.EventHandler(this.gridPredictorCases_ClickEvent);
this.gridPredictorCases.DblClick += new System.EventHandler(this.gridPredictorCases_DblClick);
I have a third party grid control inside my form. The cell in question has a dropdown combo that appears only if I double click on the cell. I like to be able to click once and have the dropdown open up.
Thanks
|
|
|
|
|
Your event handlers don't control this behavior. Events are only raised as a result of clicking or double-clicking. If you need to change this behavior, you most likely need to extend the class and override key methods. The only way to find more information about that is to ask on any site forums related to this third-party control or to contact their technical support. This forum is for pretty much generic C# questions - not typically questions related to a particular product (especially third-party products that no one else would most likely be knowledgable about).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath;
I posted the question in generic terms. I figured that a double click is a double click no matter how it is cooked and what banner it comes under.
But I see your point. I got it figured out based on your hint.
Thanks
|
|
|
|
|
You can easily solve this -- if the third party control exposes the Click event AND you are already handling the DoubleClick event.....
control_DoubleClick += new EventHandler(myProcessEvent);
control_Click += new EventHandler(myProcessEvent);
In this case you are handling both double and single click events equally.
If the control automatically handles the DoubleClick (instead of you) then you need the Click event as well as a method to execute the DropDownBox process as well. Then you would be doing this:
control_Click += new EventHandler(myProcessEvent);
...
private void myProcessEvent(object sender, EventArgs args)
{
control.DropDownBox();
}
If the vendor does not outwardly offer these options, then you need to ask them directly. You may have to wait for a new release to get the features or you may have to inherit the control and try hooking into its' base control object events.
_____________________________________________
Of all the senses I could possibly lose, It is most often the one called 'common' that gets lost.
|
|
|
|
|
Hi All,
I have a ContextMenu. At the leaf node user want to see both the Code and description as follows.
1 - Employee
2 - Customer
3 - Administrator
Is there any property similar to ValueMember (as we have in ComboBox) in MenuItem. I want to be able to get value of code i.e. 1 or 2 or 3 when a leaf node is selected.
Thanks
Ruchi
|
|
|
|
|
You mean like MenuItem.Index ?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
No, not index.
code and Description can be
167 - Employee
256 - Administrator
234 - Customer
So what I am displaying on the leaf node in above information. But when any of above node is selected, I want to get 167 or 256 or 234 as the value. LIke in combobox, we set Display member and valuemember.
Rigth now I am tokenizing the leaf node upon selection as -
dealNo = dealNo.Substring(0, dealNo.IndexOf("-", 0));
to get the reqired piece of information.
|
|
|
|
|
The MenuItem isn't a data-binding control like the ComboBox . What you see is what you get - there is nothing "behind the scenes" that track information like this. That doesn't mean you can't add it, though. Extend the MenuItem class with your own and add a property to hold this information. In the MenuItem.Click handler elsewhere in your code, you cast the sender (the first parameter) to your MenuItem derivative class and get the value of that property.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for prompt response. You are a genius.
Ruchi
|
|
|
|
|
Just wondering if its possible to create a web page snapshot with C#. Check this example:
http://www.pcworlddownload.com/internet/browser-utilities/IESnap.htm
This tool adds a button to IE toolbar and when clicked it saves the web page as png file.
I'm working on a similar project but can't solve this part.
Any help is appreciated.
Thanks.
|
|
|
|
|
One way is to use IExtractImage , a shell interface in Windows XP and higher. There is an article that describes it at http://www.vbaccelerator.com/home/NET/Code/Libraries/Shell_Projects/Thumbnail_Extraction/article.asp[^] using VB.NET, but most everything is calls on the FCL and your own interfaces anyway, so it shouldn't be hard to translate. I wrote some code that works in a similar fashion a while back, but my computer isn't currently generating previews for HTML (hasn't for a while) so I can't gaurantee it works correctly).
Another way would be to supply an HDC for an image that IE would use to print to instead of a printer HDC . Off the top of my head, though, I'm not sure how you'd do this.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The following article (by me ) may be helpful to you.
http://www.codeproject.com/miscctrl/viewobjsnap.asp?target=viewobjsnap#xx731389xx[^]
You'd have to do COM interop from C# to use this method.
I'm not aware of a more IE-specific solution to this problem. In addition, in the intervening 4 years since the article was written, the IE COM interface may actually have started exposing the functionality you want. I'm not sure, though...
Russ
--
Russell Morris
"So, broccoli, mother says you're good for me... but I'm afraid I'm no good for you!" - Stewy
|
|
|
|
|
He asked this question some time back, too. Several of us suggested taking a screen shot (easy enough with code) but he didn't want that. Isn't that pretty much what you're doing in yours (since Draw wouldn't/shouldn't paint hidden regions)? You probably weren't aware that he asked before and that screen shots wasn't what he wanted, but I'm just trying to clarify what I gathered from your article.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
IIRC you can tell Draw how much to draw (ie in what bounds). However, it's still just a screenshot with a few bells-n-whistles, as you point out. Since HTML is inherantly non-paginated, I'm not sure how much better you could do than that. I wonder if the 'Preview' functionality of explorer could be harnessed somehow for this?
--
Russell Morris
"So, broccoli, mother says you're good for me... but I'm afraid I'm no good for you!" - Stewy
|
|
|
|
|
To print a document to an image is what I was getting at in my reply above. Windows Explorer also uses an IExtractImage implementation that it gets from the shell object (like an HTML document) that it displays in the preview screen at the left in XP. So, yes, it does have this functionality. Getting it to work in .NET is tricky since you have to re-declare a bunch of interfaces and their dependent structs and enums.
There's also a way to create a "printer" that provides an HDC attached to the right information and have it print to an image (Office 2003 comes with one). This tool he mentions may do something similar (I'm not about to download it). There's other ways that you can have IE paint to an HDC you provide, but I can only find this for IHTMLPainter implementations that are implemented by binary behaviors (so they are in-place elements).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i'm trying to connect using HttpWebRequest class, but i'm getting a 401. i read in the documentation that i need to check the WWW-Authenticate header to see how to perform authentication. the info in the header is "Negotiate,NTLM". do i pass this string into the second param of CrendentialCache.Add()?
|
|
|
|
|
See the documentation for the Credentials Property[^] in the .NET Framework SDK for more information and an example. You don't need to handle the authentication headers yourself, merely pass an ICredentials implementation like the NetworkCredential class. This can already handle basic, digest, HTLM, and kerberos authentication.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
My problem is that the key message must be caught in the DataGridTextBoxe`s TextBox which is read only and can not be assigned to which means the Key Events can not be caught due to protection level.
I tried doing it by adding an inner TextBox control to the TextBox but I am having problems with this solution and there must be a more elegant one.
|
|
|
|
|
Instead of trying to change the Enter key to the Tab key, just make then do the same thing. Handle the Enter key and perhaps use the Select Method[^] on the DataGrid or something similar.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi , Still Not Working
The Enter Key does not raise the KeyPress,KeyDown or
KeyUp events so it is not working.
Thanks for the attention.
|
|
|
|
|
Then try something different, like overriding ProcessDialogKey . Worst case scenario is that you'll have to extend DataGridTextBoxColumn and override the WndProc for the actual TextBox that's used (assuming its protected and the property is virtual, otherwise you'll have to make your own) and handle the key strokes accordingly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath I will try that.
|
|
|
|
|
I have four mdi child forms on a mdi parent. I cannot find a way to disable the moving of these child forms. I can move them clicking the left mouse button and dragging the form to a different location. It seems like I am dragging and dropping the child forms but I do not get any drag or drop events. Can anyone tell me how to disable the movement of child forms, and how I can catch the movement if I allow it?
Thanks in advance
|
|
|
|
|
Moving a window is not a drag and drop action, as in dragging files and other objects. It's simply a windowing action that updates the coordinates, invalidates the necessary regions, and re-paints the form and the old background region. No DND events would be fired.
If you don't want your MDI child windows to be moved, then you probably shouldn't be using MDI. The whole purpose of MDI is to have child windows within a parent window that act like any other windows. The only way to disable movement is to handle the mouse events and while the mouse is down, retain the coordinates in the MouseMove event, which isn't easy. You can also override WndProc and handle the windows notification messages, canceling them if possible (and it isn't always possible). For this, you need to read about the Windows Management APIs in the Platform SDK at http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing.asp[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|