|
It supports CHM, but you can use whatever help you want if you provide the implementation by handling the HelpRequested event (or overriding OnHelpRequested in derivative controls).
IMO, CHMs are much better anyway. It's a better interface, easier to write for (you can use any HTML too and the HTML Help Workshop, where writing .hlp files is bit more of a pain).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Stewart..
I already had the code for the above events.. but i have the problem with the following..
--------
I have my old application in java(Microsoft VJ++) and this application uses winhelp file(.hlp) to provide help for the application. This application has a form and a help control on that..when i clicked it , it displays the help related to the form..Internally the code looks like this..
Help help = new Help();
help.showHelp(string helpfilename.hlp, string topic id);
Ex; helpfilename looks like "x.hlp"
Topic id as "906"
---
I have converted the above application to .NET framework..I am using C# as the language..
So i want to know the equivalent function for the above.. I tried using the following code as a replacement for the above.
HelpNavigator navigator = HelpNavigator.Topic;
System.Windows.Forms.Help.ShowHelp(this, "helpfilename.hlp", navigator, "topic id");
So i used this code:
HelpNavigator navigator = HelpNavigator.Topic;
System.Windows.Forms.Help.ShowHelp(this, "x.hlp", navigator, "906");
But the above code is not poping up anything..
Can anyone plz help me..
Thanks
Sudhakar
|
|
|
|
|
As I mentioned before, the help classes in .NET only work with HTML Help 1.x files (.chm). If you want to open a WinHelp file (.hlp), you should P/Invoke the WinHelp [^]:
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern bool WinHelp(
IntPtr hWndMain,
string lpszHelp,
[MarshalAs(UnmanagedType.SysUInt)] IntPtr uCommand,
[MarshalAs(UnmanagedType.SysUInt)] IntPtr dwData); The last two params are processor-dependent types, which is why they are defined each as an IntPtr . To pass these values correctly, you'd use whatever int or long (doesn't really matter) and pass them to the constructor for the IntPtr like so:
IntPtr param1 = new IntPtr( 1); This doesn't make a pointer to one - just wraps the value 1 in a processor-dependent integer. This is for portability on 32- and 64-bit processors (something a lot of examples fail to take into account).
You can find the enum constants (and what to pass into dwData depending on the constant used for uCommand ) in the documentation for the WinHelp function at http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/winhelp.asp[^]. These constants are defined in WinUser.h in the Platform SDK (installed by default with VS.NET).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Stewart..
I have tried with the approach u mentioned and i am able to display my help successfully.. Initially i thought we can use .NET classes to display winhelp files.. But with ur comments i realized we have to use windows api's to display these files..
Thanks Once again..
Sudhakar
|
|
|
|
|
I'm having problems adding 2 web references to my project.
1) When I go to add the web reference, it shows that there is a service, and it has the method querey(). However, when I add it, I do not see this method any where in the c# file. This problem also occurs when I download the wsdl for the webservice and run wsdl.exe.
2) Another web reference, when I try to add it, I can go to it, and see the documentation and methods for it. However, in the "Web services found at this URL:" box it says "The proxy settings on this computer are not configured correctly for web discovery. Click the Help button for more information." and won't let me add the web reference. I've clicked the help button, but haven't seen anything that tells me what I need to do about the proxy settings.
Does anyone have any idea on either why the method disappears in #1, or what proxy settings need to be for web discovery?
Thanks for your help.
|
|
|
|
|
Hi,
I am a beginner to C#.How do I create a library file in C#? And how do I invoke it im my program?
Karteek
|
|
|
|
|
This is a fundamental and broad question Karteek. You really need to pick up book or do some C# tutorials to understand the basic concepts.
To get you on the right track you need to learn about classes and instances. In C# a class is normally stored in a .CS file.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
I have a unsolved query in my mind. Suppose i have n-number of product which are identified by colors and stored in some table.
ColorName$ProductName( here the ColorName is hexadecimal value)
eg: #ff453787$Shirt
Like this i have lot of data in a table called Colortab.
I want to bind this data to a datagrid. Here datagrid have to show the color and the name.
that is it will convert the hexadecimal to Color + $ + ProductName
Is this possible to show in datagrid?
Sreejith S S Nair
|
|
|
|
|
Is its windows forms or asp.net datagrid ?
There are various ways you could do it, can we see what you've got and then take it from there ?
Try not! Do or do not, there is no try. - Master Yoda
|
|
|
|
|
Convert the 32-bit integer (like ff453787) to an int , then call Color.FromArgb(int) to get the color. You can then use Color.ToString . Note that for colors not defined in the KnownColor enumeration, a hex value like you already have will be output:
try
{
int argb = int.Parse("#ff453787$Shirt".Substring(1, 8));
Console.WriteLine(Color.FromArgb(argb));
}
catch
{
} If you want to match these up with colors in your "Colortab" table, then you'll need to perform a separate look-up. I would suggest constructing your SQL query to return these as separate columns to make it easier to bind. You could also in that case use a JOIN or UNION to use the names in "Colortab" instead of the hex values. You can always re-concatenate these on the server or in your client code if you want to.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanks
i got. let my try that.
Sreejith S S Nair
|
|
|
|
|
i tried your answer. but i can't see the color and no error. Only i can view the value 0 on the place of color.
Sreejith S S Nair
|
|
|
|
|
I am trying to retrieve a property from the current executing assembly using the following but am getting a TargetException
int MyInt = Convert.ToInt32(Type.GetType(Page.GetType().BaseType.FullName).GetProperty("MyIntProperty").GetValue(null,null));
Anybody know what I'm doing wrong?
Thanks
monkey say, monkey doo
Uncle Monkey
|
|
|
|
|
Wow! You really should split your lines up into distinct pieces - it greatly helps during debugging your application.
You're doing a few things that aren't necessary and would hamper performance, like Type.GetType(Page.GetType().BaseType.FullName) . Instead, you already have your Type using just Page.GetType().BaseType .
Also, when you call GetValue you must pass the instance of the object (presumably Page ) otherwise you would get an exception since you're trying to retrieve the value of a null reference.
Also, if you flatten your instance members, you really don't need to refer to the base Type to get the property where it's declared. Unless BindingFlags.DeclaredOnly is specified, all instance properties - both declared and inheritted - are reflected (not so with statics, unless you specify BindingFlags.FlattenHierarchy ). In ASP.NET, which I assume you're using since you have a Page object - though this could be anything - there is actually a large hierarchy of pages that extend from the Page class, such as your .aspx file : your code-behind page class : Page .
Type t = Page.GetType();
PropertyInfo prop = t.GetProperty("MyIntProperty", BindingFlags.Instance |
BindingFlags.Public | BindingFlags.NonPublic);
int MyInt;
if (prop != null) MyInt = (int)prop.GetValue(Page, null);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, worked a treat
monkey say, monkey doo
Uncle Monkey
|
|
|
|
|
Hi there,
I have one question regarding adding code comments (summary, etc.) to namespaces and assemblies.
If I generate the comment web page I get some html pages which contains my comments for classes and members, but not for namespaces and assemblies.
In java (or at least in Eclipse) there is a choice to have package.html documents to be included as document comment for packages (namespaces). Is there any such feature in .Net, C# or Visual Studio .Net (2003)?
If not, are there other tools to create proper reference manuals from code comments in C#.
Thank you!
Michael
|
|
|
|
|
There is no standard tags for commenting a namespace. If you use NDoc[^], we did add the capability to do so however, and it's discussed in the product documentation. NDoc is a very power, extensible, and FREE API documentation generator for .NET and can generate many types of documentation formats, like HTML Help 1, Help 2 (for VS.NET), and several others. You can always add your own documenters as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, for your quick answer. I will take a look into NDoc, this should indeed solve my problems.
Thanks again!
Michael
|
|
|
|
|
i'm a newbie in C#. I have a datagrid and I want that when I doubleclick a row to load a new form with textboxes in which I'll have the data from that specific row. how can I pass the data between the datagrid and the new form textboxes?
Thx in advance and I hope I was clear in my request, because my english really sucks )
|
|
|
|
|
hi,
follow the steps below...
a) Write a class that can hold the inputed data(values from textboxes)
b) Make an object of this class in your calling form
c) handle the double click event of the datagrid.
d) In the delegate instantiate the data entry form and open it as modal dialog
e) while instantiating data entry form pass the object of the data class through the contructor(you need to modify the constructor of the data entry form to accept an object of type : data class)
f) Give the "ok" or "close" button in the data entry form a dialog result... say "OK"
g) On click event of ok button populate the data class with the values.
h) in the calling form check for the dialog result right after you call "ShowDialog()" in the data entry form
i) if the dialog result is OK then populate the datagrid with the values in the class object
rest is upto your guess work... and how u can enhance this...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
|
//Note : before running this code please show some data on datagrid.
//write your code on doubleclick event of your data grid.
//this code is not full. here you will get
//an idea and remaining you have to develop based on your requirement.
//If this is not self explanatory then please let me know that.
//here you will get the point that where you clicked.
Point pt=dataGrid1.PointToClient(Cursor.Position);
//row or coloumn no where you clicked
DataGrid.HitTestInfo hit=dataGrid1.HitTest(pt);
//here i am checking whether i clicked on row header the show the form .use Hittesttype enum to achive your idea
if(hit.Type==DataGrid.HitTestType.RowHeader)
{
Form2 Frm=new Form2();
Frm.ShowDialog();
// you got the idea right.
//use the below line to get data from datagrid or set data to datagrid
dataGrid1[hit.Row,0]="haha";
}
Sreejith S S Nair
|
|
|
|
|
thx a lot, this was very helpful
|
|
|
|
|
hai there,
i have a form with two label control. i need to click on that control. how ? using mouse right. ha ha.
here i need to call the click event programatically without clicking on that control. I won't use any custom event handler here .
Is it possible to control the event triggering through programmatically
Sreejith S S Nair
|
|
|
|
|
Hi,
If you are trying to call the event delegate from any perticular place... say...
you want that when you click on the first label the second lebel controls click event should trigger...
if this is your plan... then you don't need to trigger an event actually... you call the delegate method directly with the necessary parameters... or incase you don't need the parameters send null.
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|