|
Yes off course it helps, now I knew how to read it from file..
I will have to find a way to plot those lines somehow..
Thank You very much
|
|
|
|
|
For plotting your node list you could derive a class from Panel and then override the OnPaint function.
I'd save the ArrayList of Point s as a property of your new class:
protected ArrayList _graph = new ArrayList();
public ArrayList GraphPoints
{
get { return _graph; }
set { _graph = value; Invalidate(); }
} Then you can write something like this in the overridden function:
protected override void OnPaint(PaintEventArgs pe)
{
Point[] points = new Point[GraphPoints .Count];
GraphPoints .CopyTo(points);
pe.Graphics.DrawLines(Pens.Red, points);
} Regards,
mav
|
|
|
|
|
HI~
I written a class Form1 which inherit system.windows.forms.form
I close a form using "f1.Close()" and then later I new it again using the statement "f1 = new Form1()". When I click and use the control inside the form like tabControl, it causes a "System.ObjectDisposedException" error.
I have new the form again by why still say the object is disposed?
How to solve the problem?
thanks~
|
|
|
|
|
hi,
I didn't get you.
You Wrote
written a class Form1 which inherit system.windows.forms.form
I close a form using "f1.Close()"
that's is fine
you Wrote
I new it again using the statement "f1 = new Form1()".
from where you are calling this ?
You Wrote
When I click and use the control inside the form like tabControl, it causes a "System.ObjectDisposedException" error.
What you mean by this ?
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
sorry~
I have a class group all the form together.
First, I create an instance of class Form1 by using this statement
"Form1 f1 = new Form1()";
Then I somewhere call "f1.Close()".
As the object f1 is close, then I execute this statement again"
"f1 = new Form1();" in the grouping class
note the instance "f1" is the same instance as the previous call.
then after I execute this statement and execute "f1.Show()", f1 is shown on the screen. However, when I use the method of the control and this form, say, "this.textBox1.Text = "something"; ", it causes an System.ObjectDisposedException.
I think I new f1 again through it is closed before. However, exception occurs. WHy?
Thanks
|
|
|
|
|
HI,
On next instance call make sure whether object is alive or not.
if(f1.Equals(null))
f1=new Form1();
else
f1.textbox.text="something";
If this idea doen't surve your purpose then please send me the code block. i can help you. Sure.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
In fact, I have create the instance again after the form is dispose. However, it still throw object dispose exception.
In fact, after the form is closed, the object instance still NOT equal to null. I see it in the watch window.
Is there any other way to solve it?
|
|
|
|
|
hi,
it may simple logical error. if it is possible show me the code.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi,
In my application I have to call an external application (System.Diagnostics.Process.Start("C:\\NeckingRa\\Fortran\\necking_contour.exe"), (command window) , which creates one FILE that I need for my calculation, and thats why I need to pause my app untill external app is done (terminated).. Please, can somebody help me?? How can I do it?? Thanks
|
|
|
|
|
|
cant find .EnableRaisingEvents
|
|
|
|
|
It's a property of the Process class. You get an instance of Process from System.Diagnostics.Process.Start() ...
mav
|
|
|
|
|
Firs thankYou for help..
But I am not wery god in it..
I have to make a little application and call extern .exe file, wait untill its done and go on.. this extern .exe file creates a file i need in my calculation..
i have a button, and when I click on it:
private void button3_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process.Start"C:\\NeckingRa\\Fortran\\necking_contour.exe");
********* Hier I have to wait until this .exe app creates output.dat***************
********* how would U do it? Can U please write it for me, (I am beginer ********
System.IO.File.Exists("C:\\NeckingRa\\Temp\\output.dat");
System.IO.File.Copy("C:\\NeckingRa\\Temp\\output.dat",DSave.FileName,true);
}
|
|
|
|
|
using System.IO;
using System.Diagnostics;
private void button3_Click(object sender, System.EventArgs e)
{
Process p = Process.Start("C:\\NeckingRa\\Fortran\\necking_contour.exe");
p.EnableRaisingEvents = true;
p.Exited += new EventHandler(ProcessExited);
}
private void ProcessExited(object sender, EventArgs e)
{
if (System.IO.File.Exists("C:\\NeckingRa\\Temp\\output.dat"))
System.IO.File.Copy("C:\\NeckingRa\\Temp\\output.dat",DSave.FileName,true);
} The bill is in the mail
mav
|
|
|
|
|
Thank U, it works now.. Great, I am very very thankful for Your Help..
There are still a lot of Great an Cool people outthere in the World..
Once again Thanx
|
|
|
|
|
i want draw something the save to image, but i found that if use "BitBlt" function,if the window is overlaped by another window,"Bitblt" will copy the screen rectangle but not the window what i want.
i kown i can redraw "something" in "Bitmap" and use "Bitmap.Save()" to save to image, but i realy not want to redraw "Something" in "Bitmap",beacause redraw "Something" will waste time.
what can i do?
|
|
|
|
|
i want draw string follow a polyline, how to do in C#? e.g : i want draw a road and its name
|
|
|
|
|
This can be done, but will be tricky. I think the best would be to calculate the angle vector, and then use Graphics.TransformTranslate before writing each character. Perhaps there is something in the GraphicsPath class that mite be better?
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
Hi,
I want to sort a classes by different paramters, but no idea how to do this.
I delcared one class to store card infos, they are (string)name, (int) width and (int)height. I put them into one ArrayList, now I wnat to sort them by name or width or height. but how can I do this?
Could anyone give me some ideas or example code?
thanks for help.
|
|
|
|
|
|
|
Any idea how to disable some items in C# ComboBox?
|
|
|
|
|
hi,
Item Means List Content.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Absolutely yes, I've found similar article but was done in VC++ 6.0 and I don't know how to convert it to C#..
|
|
|
|
|
hi,
Change your DrawMode property of combobox to OwnerDrawVariable. And then try to override the DrawItem event of your combobox.
Note : "DrawItemState enumeration" use this keyword to find help from MSDN.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|