|
Using C# in VS.NET 2003, I included the system.windows.forms namespace but i can't find the HTMLElement. It should be available. How come?
Any suggestion pls?
|
|
|
|
|
I think this class is only available in Dot Net 2.0 (VS 2005).
|
|
|
|
|
That means i have to buy a new version If so then this is terrible . Is there something else i can do?
|
|
|
|
|
You could try to use the XmlDocument / XmlElement objects - but that gave me a lot of trouble.
Or you could just use the Express version
|
|
|
|
|
|
Hi
Can anybody help me with the code how to loop a windows forms datagrid using c#
Regards,
Sivaprasad
|
|
|
|
|
hi friends,
do any one of you have any idea about returning more than a single value from a function.
if so, do favour me by sending some sample codes as early as possible
Thanks
Suresh.C
|
|
|
|
|
Use collection object
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
|
|
|
|
|
You could use output parameters.
eg
private bool SomeFunction(string inParameter, out string outParm)
{
outParm = "someValue";
return true;
}
|
|
|
|
|
You could also create a struct which encapsulates all the the members you would like to return. The function would return an object of the structure type.
|
|
|
|
|
I always prefer this approach when output is not also an input.
|
|
|
|
|
sukaan wrote: do any one of you have any idea about returning more than a single value from a function.
The preferred option is to create a class to hold the values that you wish to return.
sukaan wrote: if so, do favour me by sending some sample codes as early as possible
class MethodResult
{
public int SomeInteger;
public string SomeString;
}
class SomeClass
{
public MethodResult SomeMethod()
{
MethodResult result = new MethodResult();
result.SomeInteger = someLocalIntegerValue;
result.SomeString = someLocalStringValue;
return result;
}
}
|
|
|
|
|
In summary, you can use (in decreasing 'quality' order):
1 returning one reference value (say an instance of class myResults) holding all the results
this is the preferred way, certainly if lots of results need to be made available
2 returning a small struct
small here means no more than 8 bytes (e.g.2 ints)
3 one ref or out parameter holding a struct
this avoids the creation of the myResults instance
4 returning a large struct
this causes a lot of data moving around when there are many results to report
5 out or ref parameters each holding a simple variable
this gets clumsy and cumbersome very soon
6 public class members in the class that contains your method, so you can obtain
whatever subresult you may need
not structured, not thread-safe, the complete opposite of modern OO techniques
So I suggest you try and stick to 1, 2 and 3.
Luc Pattyn
|
|
|
|
|
I always like reading your summary!
First of all because it's always well structured and of corse correct!
But also because you are not using specialized english words which are difficult to understand (for me at least)!
Thanks!
|
|
|
|
|
My code is,
AxMSChart20Lib.AxMSChart chart = new AxMSChart20Lib.AxMSChart();
chart.Title.Text = "My first chart";
this.Controls.Add(chart);
When i use this code, i get this exception,
"InvalidActiveXSateException was unhandled"
Exception of type:
'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.
Can u tell, how can this be corrected?
Thanks for your time and patience-Guna
|
|
|
|
|
Hi can anyone help me create a simple calculator using asp.net web form with C# language. Or if anyone could help me locate one
thankyou.
|
|
|
|
|
Smells like homework. What have you done already ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
|
thanks for the help, reallly appreciate it.
|
|
|
|
|
I am looking for an interactive diagram component for WinForms. If you have seen or used Corgent Diagrams then thats what I need. Corgent Diagrams is really neat but really expensive too.
What I need is the ability to create diagrams in design time then load the diagram into a Winforms application and then let the user double click or right click different parts/shapes/connectors in the diagram to select various menu options. So imagine a flowchart created in design time. When a user right clicks on a certain shape I want to be able to handle the event and present the user with a menu based on the shape. Imagine loading a visio file into your application and then wiring all events on all shapes to some code. Does anyone know of such a library or component?
Thanks.
|
|
|
|
|
Ok, I'm having a few problems with designer in Visual Studio...
I have a MainToolbar class which has buttons on it (e.g. Forward, Back). The buttons are private but they're exposed publicly via various Properties, e.g. ForwardShown, ForwardEnabled. These properties have 3 Attributes...
[Browsable(true), Category("Icons Visible"), DefaultValue(true)]
Now I place the MainToolbar on a Form called FormBaseEdit and it works well.
The value for the properties like ForwardShown is true and NOT bold (as it should be). The MainToolbar is a protected member of FormBaseEdit.
The problem comes when I then inherit from FormBaseEdit.
The properties of the MainToolbar is still true However they are now BOLD. IF you change them to false they are not bold. Then when you build the project the properties that you changed to false are automatically back to true.
Does anyone know how to stop this?
Thanks,
Chris McGrath
|
|
|
|
|
Hello Chris,
it seems that you forgot to initialize the local variables of your properties.
Setting the DefaultValue Attribute to "true" is not sufficient.
If it was DefaultValue(false), you would have luck because the boolean default is "false".
That means you would have to do:
private bool testProp = true;
[Browsable(true), Category("Icons Visible"), DefaultValue(true)]
public bool TestProp
{
get
{
return testProp;
}
set
{
testProp=value;
}
}
All the best,
Martin
|
|
|
|
|
My MainToolbar contains a ToolStrip which has the buttons on it, the buttons already default to true, so my properties look like
<br />
[Browsable(true), Category("Icons Visible"), DefaultValue(true)]<br />
public virtual bool FirstShown<br />
{<br />
get { return btnFirst.Visible; }<br />
set { btnFirst.Visible = value; }<br />
}<br />
As I said it works perfectly if I place it on a form.
The problem is when I inherit from the form which it is on, the Default Value Actually changes from false to true. So if I change FirstShown to false, it looses its boldness, doesn't write the line in the designer file, and when it builds it puts the value back to true.
Thanks,
Chris
|
|
|
|
|
Hello Chris,
Hmmm?
I tested it now with a simple user control which has a button on it.
I placed it on a baseform and inherit a formclass from that baseform.
And.. Same effect than you have!!
I have no real explination for that, but it hs something todo with the timing of the designer.
The designer runns the constructor code of your controls, maybe at the time where he whants to get youre property, the button is not initialized. (Just out of my head.)
I would suggest you aworkaround like this:
private bool testProp = true;
[Browsable(true), Category("Icons Visible"), DefaultValue(true)]
public bool TestProp
{
get
{
return testProp;
}
set
{
testProp = value;
button1.Visible=value;
}
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hello everyone:
I'm trying to add the my (Setup1) application to this installer package. When I right-click on Application Folder on the File System Editor. From the contextual menu, select Add, Project Output. The Project Output Group dialog box is Empty. There is no Primary output, Content Files or Source Files and the Project: drop-down is blank.
Pleae help. Thanks
|
|
|
|