The image you have posted is not viewable and cannot be downloaded without creating a Mediafire account. Please post the actual code in your original question and explain what the error is and where it occurs.
all the code I copied from microsoft company, even the top of the page I posted without you reading my first questions, now you give the same link from microsoft company. Before you criticize others, have you tried my example ?
If you pass in a host name, the Send method calls Dns.GetHostAddresses[^] and pings the first address returned.
If you want to force it to ping the IPv4 address - assuming there is one - then you'll need to call Dns.GetHostAddresses yourself. You can then find the address you want to ping, and pass that into the Send method instead of the host name.
No it doesn't; you're simply calculating a value based on whether or not it's an IPv4 address, and sorting on that value. So long as the value returned for an IPv4 address is less than the value returned for other addresses, OrderBy will sort them correctly.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
First of all, that is not a special red line, nor is that a progress bar. That is merely a horizontal line, that you can draw—or even better you can configure a border for the bottom or top control to be shown as a red solid line.
Secondly, this is a ProgressBar, that control in the picture is not. That control is known as a Slider, that lets your users slide across a range of values.
What should I install in the visual studio ?
That depends on what you already have. Most of the controls are framework-based, such as WinForms or WPF. You need to download the specific framework and then develop the app in that framework.
There are some UI control providers too, such as Telerik, Infragistics, etc. that can help you author the UI using the controls that may not be available in the framework. But this depends on your use case, what framework do you have?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
I'm playing around with graphics in C#. I've managed to create a simple application using graphic object to draw some lines and scroling text to a pictureBox. Now I've decided to put my code into a Class (like for further re-use... and mostly for the learning purposes!), but I'm stuck on how to get the graphics back from Class to my pictureBox. The problem (I think!) lies as I'm doing all my drawings in the timer_tick event...
Here's the current code I'm using...
public class Osciloscope
int SCOPE_WIDTH, SCOPE_HEIGHT; // the width and the height of the osciloscope screen
int SCOPE_HORIZONTAL_CENTER, SCOPE_VERTICAL_CENTER; //center point of the screen
int SCAN_POINT_X; //number of points in the line (the width of the scope)
int SCAN_POINT_Y; //as above but vertical (input...)
//Graphics _Image; // get the bitmap
public Osciloscope(PictureBox picture, bool Run, int Interval)
SCOPE_HEIGHT = picture.Height;
SCOPE_WIDTH = picture.Width;
TIMER_INTERVAL = Interval;
//calculate mid point if the scope
SCOPE_HORIZONTAL_CENTER = SCOPE_WIDTH / 2;
SCOPE_VERTICAL_CENTER = SCOPE_HEIGHT / 2;
SCAN_POINT_X = 1;// leftmost point on the screen (start scan)
SCAN_POINT_Y = SCOPE_VERTICAL_CENTER; //the line runs in the middle of the screen
//_Image = img;
_Image= new Bitmap(SCOPE_HEIGHT, SCOPE_WIDTH);
Timer t = new Timer();
t.Tick += new EventHandler(t_Tick);
t.Enabled = true;
t.Interval = TIMER_INTERVAL;
void t_Tick(object sender, EventArgs e)
g = Graphics.FromImage(_Image);
p = new Pen(Color.Green, 2f);
SCAN_POINT_X_NEW = SCAN_POINT_X + 1;
SCAN_POINT_Y_NEW = SCAN_POINT_Y; //Math.Sin(SCAN_POINT_X);
// draw the line
g.DrawLine(p, SCAN_POINT_X, SCAN_POINT_Y, SCAN_POINT_X_NEW, SCAN_POINT_Y_NEW);
//bmp = _Image;
//DrawGraph = _Image;
// = _scope;
SCAN_POINT_X = 1;
//private Image drawGraph
public Image DrawGraph
... and the form itself...
public partial class FrmMain : Form
private void FrmMain_Load(object sender, EventArgs e)
Osciloscope = new Osciloscope(Scope, true, 5);
//Osciloscope.Image = Scope;
//Scope.Image = Osciloscope.Image;
As I said: I just can't figure out how to get the drawing into the pictureBox... (Scope is the name of the pictureBox!)
Any help woul be highly appreciated!
// EDIT: There's no scroling text in current code as I left it out for simplicity...
Well, that's the problem I'm having... don't really know how to do it! (As I've mentioned before, I'm a novice trying to learn things the hard way...
I grabbed and sniffed various code samples here on CP and mollested Google for quite some time but to no avail...
Would you be so kind to just point me in the right direction?
Last Visit: 13-Dec-19 12:19 Last Update: 13-Dec-19 12:19