|
Search "zedgraph" in codeproject search.
there are a class to solve it!
|
|
|
|
|
I am new to .Net and C#. I have written a few programs but am having trouble figuring out how to create an exe file.
Where are the settings for creating a distributable executable when I do a build?
Thanks
Gary
|
|
|
|
|
If your using visual studio, make an application project, same with #develop...if you not using either of those, you can use csc.exe from the framework (the compiler).
To those who didn't make it, we will remember you. To those who did is back. - Megan Forbes in Black FridayAnother Post by NnamdiOnyeyiri
|
|
|
|
|
Hi,
how to create Icon from binary reource when using namespaces ? Thanks
|
|
|
|
|
I have some questions about moving a PictureBox on another PictureBox:
1.
My Project needs to show a picture so I use a PictureBox,
and sometimes I need to insert some small pictures on it,
How can I dynamic new some pictureBoxs on the original PictureBox...??
2.
After adding a PictureBox on it,
I need to move the PictureBox to the position I want with my mouse,
How can I draw a ---(dot line) Rectangle in my MouseMove event to avoid flickering problem...??
Please give me a hand,thanks!!
|
|
|
|
|
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Dim pic1 As System.Windows.Forms.PictureBox
pic1.Width = 50
pic1.Height = 50
pic1.Image = CType(Resources.GetObject("PictureBox1.Image"), System.Drawing.Bitmap)
PictureBox1.Controls.Add(pic1)
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
First your gonna run into the problem of the picture box not being transparent. Cause the control is not a transparent control. You have to derive a class from the picturebox and then override the onpaint function to draw your image otherwise its gonna cover up whats behind it looking all crappy.
The flickering problem if you will look at my article on anti flicker you will see how to enable double buffering. Double buffering is turned off by default.
Hope this helps. If you need more information just ask I will try to help.
Win32newb
"Programming is like sex, make one mistake and you have to support it for a long time"
|
|
|
|
|
First thanks for you answers,
I design my project with no transparent picture now,
maybe I have to show it with transparent finally...I hope not... >_<
I type my code below:
<br />
private Point startMoveLocation = Point.Empty;<br />
private Point moveAmount = Point.Empty;<br />
.<br />
.<br />
.<br />
private void pictureBox1_MouseEnter(object sender, System.EventArgs e)<br />
{<br />
pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand;<br />
}<br />
<br />
private void pictureBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
pictureBox1.Capture = true;<br />
startMoveLocation = new Point(e.X, e.Y); <br />
}<br />
<br />
private void pictureBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
if (pictureBox1.Capture == true)<br />
moveAmount = new Point(e.X-startMoveLocation.X,e.Y-startMoveLocation.Y); <br />
}<br />
<br />
private void pictureBox1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
pictureBox1.Location = new Point(pictureBox1.Location.X + moveAmount.X,pictureBox1.Location.Y + moveAmount.Y);<br />
pictureBox1.Capture = false;<br />
}<br />
Now I can move the picture as I wish,
but during mouse move,I don't know how to draw a dot line rectangle
to let user know the process,
Can you help me solve this question...??
Thank you very much !!
|
|
|
|
|
Hi All,
Can anybody help me?....
I am using a datareader to read from the database, i have the select query for this & reading the contents of the table ok...
I am getting the correct output using a datareader for the datagrid ....as....
DGShow.DataSource=dread;
DGShow.DataBind();
...but i want to put the same contains in the textbox also....but whenever i read the contains i am getting this error message....
Exception Details: System.InvalidOperationException: Invalid attempt to read when no data is present.
the code is......
while(dread.Read())
{
txtEmpID.Text=dread.GetString(0);
txtEmpName.Text =dread.GetString(1);
txtcity.Text=dread.GetString(2);
txtphone.Text=dread.GetInt32(3);
}
as i am not sure that i m on right track please help me..
thanks
|
|
|
|
|
DataReader gives you a forwatd only reading. So once you go to the end of it ,you can't return to first row again.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
You can't use a datareader as your datasource if your binding more than one control to it. You would have to bind them to a datatable in a dataset...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I draw a curve using the DrawCurve method. I also want to have some kind of interaction with the curve when moving the mouse over it. Could someone show me how to decide if a Point is on the curve?
Thanks!
|
|
|
|
|
Hello,
The way I have seen this done was in a project I worked on in a group for school.
Check out the Region and GraphicsPath classes. Region is found in System.Drawing and GraphicsPath is in System.Drawing.Drawing2D .
1. DrawCurve to screen
2. Create a GraphicsPath and draw to it.
3. Create a Region from the GraphicsPath .
4. Invoke IsVisible( somePoint ) on the Region .
In this case somePoint would be your mouse point.
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
|
There is a problem with this method. Though the curve is a open end curve, the region seems like a closed region. IsVisible returns true not only when the mouse is over the curve but also inside the region enveloped by the region. Have you encountered the same problem? How did you resolve it?
Thanks!
|
|
|
|
|
Hmmm.... I don't know how to fix that problem right off had. You will have to look through the documentation some more. I am sorry that this did not solve the problem exactly. Please post here again if you find a solution.
Sorry,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
I found the same problem as above and your description of the problem helped to give me the answer. If the path is closed already, the path.IsVisible(point) should work.
To keep the line as pure looking as possible using pixels, just reverse the points in the array and add them to the original set. Then add them to a closed curve in the path.
<br />
GraphicsPath _curvePath = new GraphicsPath();<br />
List<PointF> closedCurvePoints = new List<PointF>(_curvePoints);<br />
closedCurvePoints.Reverse();<br />
closedCurvePoints.AddRange(_curvePoints);<br />
_curvePath.AddClosedCurve(closedCurvePoints.ToArray());<br />
This worked well for me - even for curves that backed in on themselves. Hopefully it will be helpful to someone else if you have no need for this info anymore
|
|
|
|
|
Hi,
I am trying to create a program that connects to a remote host, and also acts as a server to listen for incoming connections (two in one).
However I want the program to begin listening for incoming connections immediately.
Two instances of a socket and IPEndPoint are created (In seperate classes, one for connecting and one for being a server), however they both use the same port number (As the program is a client/server).
Is this possible? Can I bind to the same endpoint as I am connected to / trying to connect to and send/receive data in both instances?
Thanks!
|
|
|
|
|
|
First off, sorry for the long question but I wnat to try and be clear. Any ways I have the following code:
static void Main()
{
Application.Run(new Form1());
}
Here is the constructor for Form1
public Form1()
{
// Form 1 Control definitions removed
newClass1= new NewClass();
newClass2= new NewClass();
Thread Thread1=new Thread(new ThreadStart(newClass1.Start));
Thread Thread2=new Thread(new ThreadStart(newClass2.Start));
Thread1.Start();
Thread2.Start();
}
Here is the New Class Constructor:
Public NewClass()
{
Context=new ApplicationContext();
Form2 ChildForm1=new Form2();
Form2 ChildForm2=new Form2();
Context.MainWindow=ChildForm2;
}
Here is the thread Start delegate:
public void Start
{
Application.Run(Context);
}
If a method on Form 1 wants to call a method on the instance ChildForm1 an Invoke call must be used and it works. However if a call on Form1 wants to call a method on ChildForm2 the InvokeRequired property always shows false and an Invoke call won't work. Why??
Thanks for an help
Jeff
|
|
|
|
|
When I add a TreeView control to a form and then run the program, a horizontal scrollbar appears at the bottom of the control, whether needed or not. How can a remove this unnessary scrollbar?
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Change the Scrollable property to false.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
I would do what you recommended, however, I want the scrollbars to show up when they are necessary. Is there some workaround for this situation?
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
bneacetp wrote:
I want the scrollbars to show up when they are necessary
Ok, I see now.
bneacetp wrote:
is there some workaround for this situation?
I've never seen one, but I would either cheat, and say if the treeview has 3 embedded nodes, change the scrollable property to true, or do it the hard way and measure the nodes to see if you truely need to scroll.
Hope this gives you some idea's
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
Aaron Eldreth wrote:
or do it the hard way and measure the nodes to see if you truely need to scroll.
It kind of looks like I may have to do things the hard way you mentioned, although it would be nice if there way some quicker way around this. Thanks for the help.
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|