|
Hi,
I've seen many articles online attempting to answer this but none seem to do what I'm after.
I have a .NET 3.5 C# project for which I created a context menu strip with an "Explore" item. This context menu is assigned to a text box. The explore item opens Windows Explorer at the location specified in the text box.
The problem I'm trying to grapple with is that because I've assigned my own context menu strip, I don't get the standard context menu items, that contains "undo, cut, copy, paste, delete and select all". Users tend to expect these items to appear when they right click a text box. Is there a way of getting a reference to this standard Windows context menu and either adding new items to it with event handlers, or add each of these items to my own context menu manually and when each item is clicked, then call the corresponding items / event handlers on the default menu?
I suspect in either case I'm going to have to do some interop work here but have no idea how to get at the menu in the first place.
Thanks,
Steve Y
|
|
|
|
|
Can you locate the textbox context menu withing the .net framework, if so you should be able to extend that menu. Funny I have never even looked into that area of the controls.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm really not sure. If you don't assign a custom ctx menu then the standard Windows appears one appears, so getting at the default one is where I'm confused. I just set the ContextMenuStrip to (none) and put a breakpoint in the mouseup() event handler for the text box. The .ContextMenu and .ContextMenuStrip properties are both null, so you can't get at the menu easily using standard .NET UI classes, at least from what I can see.
Steve Y
|
|
|
|
|
I'd take a look at the textbox in the object explorer and chase down it properties F2 on the text box I think!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Did you ever discover how to access the default
right-click context menu? I have the same issue.
Thanks,
Mike
Cheers,
Mike Fidler
|
|
|
|
|
Dear all,
I have read this article : Saving Word 2007 Documents to PDF and XPS Formats (http://msdn.microsoft.com/en-us/library/bb412305.aspx) but I do not know whether using Word 12.0 Object Library to open Word 2003 documents (or older versions) and convert them to pdf format.
Could you give me the suggestion for this?
Thanks in advance
|
|
|
|
|
What happens when you try it?
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I did not try this.
Because I do not have MS Office 2007 now and I want to make sure this way OK to answer customer.
|
|
|
|
|
pcphuc wrote: Because I do not have MS Office 2007 now and I want to make sure this way OK to answer customer.
May I suggest you do not answer your customer until you have tried and tested the solution you are offering. I know that Word 2007 can open 2003 format doc files, but that does not guarantee that your program will be able to read them and convert them successfully to PDF.
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Thanks you.
I'll try this solution for sure.
|
|
|
|
|
Hello,
I want to include a file which contains the basic string values that are required by my system.There is no #include file.h support for C# .
Is there any way where I can define global variables so that they are available for all my forms and files in the project?
HOw can i do that ?
Thanks
|
|
|
|
|
The only thing you can do is put all your variables in a public static class and put that class inside your project's namespace. You can then access them with className.variableName. If you declare them as public also, of course.
|
|
|
|
|
XajniN wrote: The only thing you can do
Not at all; that may be recommended, but there are several ways to skin this cat.
Database, config file, resource file (as far as I know), an enumeration may be of use too.
|
|
|
|
|
Well, that's one of the things you'll have to get used to with C#.
I usually define a Global class that contains all my constants and true global variables. Just reference it and use the constants/variables or refer to them as Global.Foo , etc.
Perhaps others have a more elegant way.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Ooor... pass your C# code through a C-preprocessor; there's nothing stopping you.
|
|
|
|
|
I knew I would read such a reply by you right when I saw the question.
|
|
|
|
|
Hey guys
thanks for all ur suggestions.
Prithaa
|
|
|
|
|
Yep, I almost expected someone to have already replied saying just wait until I got on.
|
|
|
|
|
Any sugestions on a very extensive book on everything C#? The C# bible is good, but outdated...last printing was in 2002. Im looking fore something like that.
|
|
|
|
|
I often refer to the spec.
|
|
|
|
|
You can hardly find any book that will cover almost everything. MSDN Library is the best place to start.
|
|
|
|
|
"Everything C#", is MSDN.
If you want something else, then you're going to have to put up with stuff being left out.
|
|
|
|
|
The Nutshell[^] book(s). Accept no substitute!
/ravi
|
|
|
|
|
is it possible to use an XML file with all XML assemblies but with an XML which has a different file extension? so it's actually an XML file but it has .ext extension?
|
|
|
|
|
It depends upon what you mean by "use", but you can read any file containing XML as XML, no matter what the extension of the file actually is.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|