|
Take a look at this CP article Sandcastle Help File Builder[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi All,
i need develop custom intellisence for a text box. Can any body help me regarding this
wiating for reply
Ramesh.Kanjinghat
|
|
|
|
|
Search the articles or the net in general for this topic and almost certainly you will get many results.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
You can start by looking at TextBox.TextChanged event handler.
Good luck
If you can't find time to do it right the first time how are you going to find time to do it again?
|
|
|
|
|
Using C# and .NET, I need to make an XML document. I've searched and all i can find is info on using XmlReader and XmlWriter, or XmlDocument after loading an already existing XML file. Problem is, I don't have or need a file. I really can't even make the file, due to security issues. I need to be able to make the XML structure in memory. Below is a sample of what I've tried so far, and the error it gives me.
XmlDocument doc = new XmlDocument();<br />
XmlNode node;<br />
<br />
node = doc.CreateTextNode( "This is a text node." );<br />
doc.AppendChild( node ); <-- System.InvalidOperationException was unhandled, "The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type."
I know I have all the right "using's", it compiles fine. My guess is the XmlDocument isn't initialized correctly, but i can't find info on how else to do so.
Any help would be greatly appreciated.
A soft glow comes from the pit in the darkness.
The clicking noise become faster - and louder.
A wind begins to stir up from the pit, as the
creature flexes it's wings, preparing for flight.
You stare into the pit, and hear a voice say
in your mind, "If you survive the encounter,
declare it to the world."
The Code Demon Rises.
|
|
|
|
|
A text node cannot be a direct child of an XML document. You have to create an element first that will become the root element of your document and add all other content to this element.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Ya, a few hours after I posted, after trying several different things, I figured it out. I'll post what I did, for anyone else having the same problem.
XmlDocument doc = new XmlDocument();<br />
XmlNode node1;<br />
XmlNode node2;<br />
<br />
doc.AppendChild( doc.CreateNode( XmlNodeType.Element,<br />
"XMLRoot", string.Empty ) );<br />
<br />
node1 = doc.CreateNode( XmlNodeType.Element, "Element", null );<br />
<br />
node2 = doc.CreateTextNode( "Text" );<br />
node2.InnerText = "A text node";<br />
node1.AppendChild( node2 );<br />
<br />
doc.SelectSingleNode( "XMLRoot" ).AppendChild( node1 );<br />
<br />
doc.Save( Console.Out );<br />
<br />
<br />
Apparently, nodes can only be added to Element nodes. I haven't worked much with XML, so perhaps this is obvious to others.
A soft glow comes from the pit in the darkness.
The clicking noise become faster - and louder.
A wind begins to stir up from the pit, as the
creature flexes it's wings, preparing for flight.
You stare into the pit, and hear a voice say
in your mind, "If you survive the encounter,
declare it to the world."
The Code Demon Rises.
|
|
|
|
|
Some remarks:
1. If you want to create an element why don't you use the CreateElement method. This way you do not need to pass a XmlNodeType value and furthermore the method as an overload where you do not need to specify a namespace URI (comes in handy for creating unqualified elements).
2. The CreateTextNode method already takes the text of the text node as argument, so by passing in "Text" and afterwards setting the InnerText property of the created node to "A text node" is redundant. Directly pass "A text node" to the CreateTextNode method.
3. Using SelectSingleNode to get the root element of your document is quite inefficient. You can access the root element of a document directly via the XmlDocument.DocumentElement property. As an alternative you could assign the root node to a variable after creating it and then append it (as done with the text node).
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I can see what you're saying. Certainly the code I posted an be cleaned up and made more efficient. I was working on this last night, and what I posted was written at 1 in the morning. It worked, gave me the output I was looking for, I was happy, and went to bed. I'll clean it up later, and let you know if I see anything other than what you mentioned. Thanks for the help though.
A soft glow comes from the pit in the darkness.
The clicking noise become faster - and louder.
A wind begins to stir up from the pit, as the
creature flexes it's wings, preparing for flight.
You stare into the pit, and hear a voice say
in your mind, "If you survive the encounter,
declare it to the world."
The Code Demon Rises.
|
|
|
|
|
I'm well aware that during the process of learning one does not always find the best way at first and is happy to find a way that works anyhow. So my posting was not intended to criticize you. Just wanted to give you some pointers what can be optimized.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi everyone,
In my project i have to run an exe independently hence i have used another C# win appn to cal the exe in the timer_tick event, but this event is not firing. The exe works fine individually. Plz help me.
Thanx,
yamini.
|
|
|
|
|
Two things are possible.
1 - the .NET framework is broken ( report it to Microsoft )
2 - your code has an error ( we can't tell what the error is without seeing it )
Do you start your timer ? How do you know it doesn't get called, do you set a breakpoint, or are you assuming that because you don't see the end result you hoped for ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanx, for your reply it is working now.
|
|
|
|
|
Hi I'm new to programming, currently I'm learning C#.
I am attempting to build an audio app DJ style and using C# and it is proving a challenge.
My questions is should I be using C# for building audio apps or is there a better programming langauge more suited to the task?
Thank you
Mike
|
|
|
|
|
mikepalma wrote: I am attempting to build an audio app DJ style and using C# and it is proving a challenge.
That's a ludicrous thing for someone 'new to programming' to attempt. Learn to program first, then worry about libraries like DirectX, or using components like the Windows Media Player control.
mikepalma wrote: My questions is should I be using C# for building audio apps or is there a better programming langauge more suited to the task?
C++ is more powerful, but I wrote a video jukebox in C# which is in constant use in clubs and pubs in the country I live in, so there's every reason to expect you can do what you want in C#, if you learn it first.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi All,
I m new in Programming with C#.
I have created a method by means of passing the values using the two dimensional array of type int[,].
ie., i am passing two matrix A and Matrix B and calculating the sum and sub for the two matrix A and B. and i m storing it in the Matrix C.
And i am calling this method in the main program everything works fine but it shows the error as
No overload for method 'AddMatrix' takes '0' arguments and the same for the 'SubMatrix' also.
I want to know how to pass the values in the main program.
with regards,
Chitra
|
|
|
|
|
chitra4sat wrote: everything works fine but it shows the error
How can both these things be true ?
chitra4sat wrote: No overload for method 'AddMatrix' takes '0' arguments and the same for the 'SubMatrix' also.
Then you forgot to pass the parameters
chitra4sat wrote: I want to know how to pass the values in the main program.
Not sure what you mean, but if you have a method
int Add(int a, int b)
{
return a + b;
}
You are doing this:
int n = Add(); // Can't do it, wrong number of parameters
but you need to do this
int n = Add( 1,2);
or this
int x = 1;
int y = 2;
int z = Add(x,y);
Or any combination of the two.
You probably need to post your code if you need to ask any more, so we can see what's going on.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
here is my code for your reference:
in the main class
Here i m giving the values for the matrix A & B
int[,] MatrixA ={ { 1, 2 }, { 2, 3 } };
int[,] MatrixB ={ { 3, 4 }, { 4, 5 } };
public int[,] AddMatrix(int[,] MatrixA, int[,] MatrixB)
{
int numberOfRows = MatrixA.Length / 2;
int numberOfCols = numberOfRows;
int[,] MatrixC = new int[numberOfRows, numberOfCols];
for (int i = 0; i <=numberOfRows; i++)
{
for (int j = 0; j <=numberOfCols; j++)
{
MatrixC[i, j] = MatrixA[i, j] + MatrixB[i, j];
}
}
return MatrixC;
}
And i m calling this AddMatrix Method in the main program as
mymatrix.AddMatrix();
in that how sould i have to pass the value
let me know it ASAP.
regards,
Chitra.
|
|
|
|
|
Thats what is worng chitra!!
You cant call AddMatrix without parameters since you have defined your method with parameters!!
What you may do is that you have to pass A and B in AddMatrix method
like
AddMatrix(MatrixA, MatrixB);
It would work then. Hopefully!!
Learning is a never ending process of Life.
|
|
|
|
|
Hi,
Thanks for ur reply.
But here,i am giving the values of Matrix A and Matrix B . I have used it as int[,] matrix A={{1,2},{2,3}};
and int[,]MatrixB={{2,3}.{3,4}};
which are the values i am sending it in the program itself .
and i m calling it in the main program as mymatrix.AddMatrix();
but i got doubt there only how to pass the values becoz the values are all mentioned above.
i need that mymatrix.AddMatrix(" how the values to be put it here ");
here if i open that method bracket it is asking the value of (int[,]matrix A,int[,]matrix B)
I am getting the problem only in passing the value only .
so please help me by code in passing the value of this line .
waiting for ur reply ASAP.
Regards,
Chitra.
|
|
|
|
|
public void TestAddMarix() {
int[,] MatrixA ={ { 1, 2 }, { 2, 3 } };
int[,] MatrixB ={ { 3, 4 }, { 4, 5 } };
AddMatrix(MatrixA, MatrixB);
}
public int[,] AddMatrix(int[,] MatrixA, int[,] MatrixB)
{
int numberOfRows = MatrixA.Length / 2;
int numberOfCols = numberOfRows;
int[,] MatrixC = new int[numberOfRows, numberOfCols];
for (int i = 0; i <=numberOfRows; i++)
{
for (int j = 0; j <=numberOfCols; j++)
{
MatrixC[i, j] = MatrixA[i, j] + MatrixB[i, j];
}
}
return MatrixC;
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I have a question survey that I need to add branching and skip logic based on how a question is answered. I need for this to be dynamic because a user can setup their own questions and determine the flow of the questions.
Any suggestions or references on how start this? Is this a rule based engine?
|
|
|
|
|
Sounds like you need to define a file format where questions are defined, and answers and question flow is marked. XML would be perfect for this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Maybe use a decision table or tree?
I agree with Christian. XML would be a good tool here.
|
|
|
|
|
can any one know how to make MDI in pocket pc in normal windows form u make the property IsMdiContainer true but in pocket pc there is no such a property
thank u all.
Best Wishes
|
|
|
|
|