|
ha, figured it out!
you have to check for the state in the overwritten OnDrawItem method.
the state which is true when the user moves the mouse over the menuItem without clicking is called HotLight. with a mouse click the state changes to Selected.
|
|
|
|
|
Hi,
That's a bit freaky! I just posted the same solution!
Does this count as Pair Programming???
Glad you sorted it.
Gary.
|
|
|
|
|
Hello again,
Just did a bit of experimenting...
I set OwnerDraw = true on a MainMenu MenuItem, and in the DrawItem handler I output e.State to a listbox. When the mouse entered the menuitem, the state was "HotLight, NoAccelerator", but when it left, it was "NoAccelerator" This will let you determine if the mouse is entering or leaving, and nobody needs to click anything.
Not sure if this helps or not - you'll have to draw your own MainMenu items (you may already be doing this).
Good luck!
Gary.
|
|
|
|
|
|
Hi,
How to hide modal dialog box when I call function InternetDial from WinInit.dll?
Thanks!
|
|
|
|
|
Hi all,
How do I know what language (VB, C#, J#, etc.) a web Project is?
Also, how do I know what type of project (Class Library, Console Aplication,
Web Project) it is?
Regards,
Rathish P S
|
|
|
|
|
If you are using visual studio ,then you will find the project file contains the language in it's extention like *.csproj , and *.vbproj.
|
|
|
|
|
I am using VS 2005 and for web projects, there is no .vbproj or .csproj in 2005. We can't use this method. Only way is some how findout the language used from the web.config file, since now all are maintaining in web.config file. Also I want to know it programmatically using EnvDTE or some objects like that. Can you help me?
Regards,
Rathish P S
|
|
|
|
|
Extension of project will tell you its type like if its abc.dll it means its a class library, or if its abc.exe its a console application.
Regards,
Ali
Ali
http://aliwritings.blogspot.com/
|
|
|
|
|
Yes, you are right. But I want to know it by using C# code. Currently I am using object of EnvDTE.Project to find it. But for webprojects, we can't follow this method since no project file in VS 2005. I want to solve this issue. If you have an idea about the solution please help.
Regards,
Rathish P S
|
|
|
|
|
In win application you can open the .sln file with the notepad and you will get there the language .
In web application there is no real deffirence between vb.net and C# ,cuz they are in html ,And if you want to know the language as a code behind file then :
It will be either *.aspx.cs OR *.aspx.vb .
|
|
|
|
|
u mean that we can do it by parsing the solution file. Am I right? I have to find out the code behind language by using C#. Now I am doing it by anylysing the extension of project.ie .vbproj or .csproj. But the real problem is that web projects in vs 2005 do not have project file. Infact all are storing in the web config file. We can use this file for parsing and identify the language. But i am trying to found out more easier way to solve this.
Thanks
Regards,
Rathish P S
|
|
|
|
|
I think this maynot be a slight big problem ,since .net 2.0 allows any web project to be in multible languages.
|
|
|
|
|
hi ..
i hav an application , i want if i enter roll no in a textbox and then click button then corresponding name of that rollno will show in other textbox..
i want to do this using dataset when dataset is filled with table "stdrecord"..
|
|
|
|
|
What I understand is user can type some text in a text box and now on click of some button, same text should go in some other text box.
Suppose Textbox1 is first textbox and Textbox2 is second, then on click of button, you only have to write this;
Textbox2.text = Textbox1.text;
Thats it!!!
and in which context are you talking about dataset... please elaborate...
Ali
http://aliwritings.blogspot.com/
|
|
|
|
|
Hi,
so if that was the case ..initially fill the dataset with the desired format ..like for the above case ..fill with number,name,.,,.etc etc
and in textbox leave event handler write the code to traverse inside the dataset and if the match found for number get the corresponding name and fill the desired text box
i hope u got!!!
With Regards,
Vinayaka Shenoy
|
|
|
|
|
I am trying to insert a NULL value into a table but don't know how to do it? Any suggestion?
|
|
|
|
|
You can use DBNull.Value for this.
mav
|
|
|
|
|
I want to serialize a class to an XML file. The class contains an array of objects. The objects are a class with 2 string members.
|
|
|
|
|
|
Hi,
I am making desktop application using C#
How can kill the process of excel file
Suppose i have opened Four Excel file
How I will detect which one to close the excel file
My application contains base files and all the tables are converted to Excel files
Excel files are invisible
what i noted that excel process is still running
I have to close the excel files after converting from database table to excel
How can i completely kill the process of excel file
regards
sanjeev
|
|
|
|
|
Isn't there a Close() or Quit() method for the Excel.Application object? I know there _is_ one for Word, so Excel should be similar...
IMHO you shouldn't kill the process, because if you need to do this it means that you haven't kept track of your references. Close all open Documents, then the COM server should shutdown, too. Or, as stated above, use Quit or something similar.
Regards,
mav
|
|
|
|
|
Ah, I have personally dealt with this before. The problem arises in the Office interop assemblies where if you do not practice the correct method of declaring variables, the instances will never go away. The first thing to remember is to never call something like:
Excel.Application oApp = new Excel.Application
...
Application.WorkBook....
What I mean by this is, you must explicitly declare each of the variables you intend to work with IE..
Excel.Application oApp = new Excel.Application
Excel.WorkBook oWB = Application.WorkBook
So any time you use a subclass within the Application model, make sure you declare a new variable for it instead of directly referencing it. The second most important thing is to lookup Microsofts NAR function and call NAR(...) on any object you create.
Excel.Application oApp = new Excel.Application
Excel.WorkBook oWB = Application.WorkBook
...
NAR(oWB);
NAR(oApp);
These two methods above will insure that all references to the Interop Assemblies are cleaned up, as the cause of lingering Excel applications are the lingering pointers to some aspect of its Application. If you need a better example I could provide you with one, I just do not have the code in front of me at the moment.
Good luck.
Here is the function provided by Microsoft:
private void NAR(object o)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(o);
}
catch {}
finally
{
o = null;
}
}
You might want to look at http://support.microsoft.com/default.aspx?scid=KB;EN-US;q317109& for a better idea if what I stated was not clear
|
|
|
|
|
In NDoc there are some additional XML tags defined that are not know to the Visual Studio 2003. As I use the autocompletion of VS2003 often even for the XML tags I am looking for a way to extend the list of the known tags and their attributes.
Is there a way to extend the list, maybe with an add-in or by editing an schema file or ...
Thanks
Roland
Wenn der Computer wirklich alles kann, dann kann er mich mal kreuzweise.
(Manfred Schmidt)
Follow your Euro notes in their tracks
|
|
|
|
|
In richtextbox, how to find & replace a string such as notepad of window ?
|
|
|
|