|
Okidoke, you don't need to worry about the X-Axis, this just always increments. So you've got an array of booleans which alter (which is pointless really as we can draw a square wave by appreciating its repeating manner).
Graphics wise you'll want a windows forms application. Derive a class from Panel. In the derived classes override OnPaint.
You get a Graphics object given to you by that which allows you to draw lines and such things.
Create the loop and draw the lines. I can't offer much more help without knowing about things like frequency, scaling etc.
Regards,
Rob Philpott.
|
|
|
|
|
Thanks Rob!!!
Your valuable points helpful to achieve the task.
|
|
|
|
|
spalanivel wrote: Square Wave form which have X and Y- Axis
And what exactly have you tried so far?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
A flexible charting library for .NET[^]
See this and try to use the function in it.
For example :
X = 0, 0, 1, 1, 2, 2, ...
Y = 0, 1, 1, 0, 0, 1, ...
That is a square wave.
|
|
|
|
|
Hi,
Using "AutoCompleteExtender" AJAX control, we can autocomplete the words, in web application.
How can I achieve the same functionality in Windows application?
Please guide me.
Thanks in advance.
|
|
|
|
|
There are some AutoComplete [^] properties on the TextBox that you can use. An example on it's usage can be found here[^].
Good luck
I are troll
|
|
|
|
|
Thanks alot Eddy Vluggen!!
Its working..
|
|
|
|
|
Hi
I want to find a node from its text in an XML file with given string.
I'm taking this text from a textbox in my application and I want to find this node from XML file and
do some changes on it like changing childrens' texts or deleting the node and it's children from file.
any help :/ ?
|
|
|
|
|
|
There's usually two approaches to XML things like this, a streaming one which has a small memory footprint or the document approach where you load the whole xml into memory. The latter is easier if your xml is not too big.
(There's also a swanky new way using Linq2Xml which I know nothing about).
Something *like* :
XmlDocument doc = new XmlDocument();
doc.Load(<the file="">);
XmlNodeCollection nodes = doc.SelectNodes("//<element name="">");</element></the>
That will return you all the child elements with the name your looking for. You can iterate over them etc.
You'll need to brush up a bit on XPath to do it, but its easy enough once you've got your head around that.
Regards,
Rob Philpott.
|
|
|
|
|
thanks for replies
I've changed my app a bit.
to be more precisive, the XML document is like:
<app>
<appname>application1</appname>
<action><arg>argument1</arg><ges>gesture1</ges></action>
</app>
<app>
<appname>application2</appname>
<action><arg>argument2</arg><ges>gesture2</ges></action>
</app>
..etc
I'm choosing a node from my treeview first, and the node in the treeview has the name with "title" node's inner text, (so arg and ges nodes are siblings for the title)
what I'm doing right now is;
XmlDocument doc = new XmlDocument();
doc.Load();
XmlNode editing = doc.SelectSingleNode(treeView1.SelectedNode.Text);
editing.NextSibling.InnerText = "changedText";
in fact, application gives "Object reference not set to an instance of an object." message pointing the "XmlNode editing = doc.blahblah" line
any further help?
edit: there's also a <title>NodeTitle1/2</> tag among arg and ges nodes which I forgot to add to xml example
|
|
|
|
|
The problem lies on you SelectSingleNode line.
You have to treat XPath statements a bit like directory structures. Unless there's a top level node of that name you won't find it.
You can use \\ to denote any (this node and all below). Try the below:
XmlNode editing = doc.SelectSingleNode(@"\\" +treeView1.SelectedNode.Text);
Regards,
Rob Philpott.
|
|
|
|
|
yeah this seems like the answer, but I couldn't understand the string structure
I've pasted your line in my code and it still gives an error:
XPathException was unhandled:
'\\Applications' has an invalid token.
:/
|
|
|
|
|
um, try forward slashes rather than backslashes - my memory may be letting me down....
Regards,
Rob Philpott.
|
|
|
|
|
Thanks Rob you've been very helpful
but now another error occured in the next line,
XmlNode editing = dom.SelectSingleNode(@"//" + treeView1.SelectedNode.Text);
editing.NextSibling.InnerText = "changedText";
I promise, no more questions =))
|
|
|
|
|
Have a look at this Linq example.[^]
hmmm pie
|
|
|
|
|
Hi All,
I have generating a problem when i am tring to Copy Image in Clipboard.
Bitmap bmp1 = new Bitmap(panel3.ClientRectangle.Width, panel3.ClientRectangle.Height);
panel3.DrawToBitmap(bmp1, panel3.ClientRectangle);
Clipboard.SetImage(bmp1);
When i paste it on Paint and Print it then Image not Showing properly. Image is streatcing.
Thanks
If you can think then I Can.
|
|
|
|
|
In one form i added graphics using paint in the picture box, how can i get the same graphics in another form's picture box,at the same time graphics should run in both the forms using c#
modified on Tuesday, April 21, 2009 8:26 AM
|
|
|
|
|
Derive a class from Picture box and override the OnPaint handler. You can then just treat your new class as a control and drop it on whatever forms you want.
Regards,
Rob Philpott.
|
|
|
|
|
Hi,
I need to insert an instance of user defined class into a datarow in datatable.
I tried casting to the class name,object everything, but its always showing as string object. Anybody having any idea about this... A sample code is given below....
dataRow[dataColumn] = (MyClass)value;
Here value is an object of type MyClass...bt after execution, the result in dataRow[dataColumn] is of type string object..
Please help...its urgent...
|
|
|
|
|
How do you want your object to be inserted in the row?
|
|
|
|
|
Just want to insert it as class object...
foreach(MyClass obj in MyClassCollection)
{
dataRow[dataColumn] = obj;
}
Just this, nothing more... bt dis is showing as "MyClass" of type object{string}
|
|
|
|
|
what is the type of dataColumn?
|
|
|
|
|
I am not sure, but I think that it is using the ToString() method. As it is managing to store the class, I can only assume that the datacolumn type is one of the text variants (varchar, nvarchar etc.).
I think that you are going to have to use blob storage techniques, together with (possibly binary) serialization, to do this.
Maybe you will get lucky and someone who has done something like this will help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
well i cant image you are wanting to display the class in any way in a cell so why dont you try using the Tag property of the DataRow? I am assuming you just need to get information from the class why you have a row selected.
dataRow.Tag = myClass;
then when you need it you can just do...
MyClass myClass = (MyClass)dataRow.Tag;
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|