|
Why don't you just concentrate on creating a well design/well written application. These bells and whistles are a waste of time.
|
|
|
|
|
Hello:
i use vs2005(C#) and the OS is WinXP.
Now i want to get the local pc's monitor's status,
include [on] [off] [standby] three status.
what should i do.....
Thanks
|
|
|
|
|
|
|
Ask the user to click a button.
|
|
|
|
|
Accurate? Yes.
Helpfull? No.
Have a five anyway!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I think he used to be an editor at MSDN...
Will Rogers never met me.
|
|
|
|
|
Excel receive live data from DDE .How to retrieve those values.I must read unsaved live data
|
|
|
|
|
Error 1 Unsafe code may only appear if compiling with /unsafe C:\Visual Studio 2010\Projects\Unsafe\Unsafe\Program.cs 6 24 Unsafe
Error 2 Unsafe code may only appear if compiling with /unsafe C:\Visual Studio 2010\Projects\Unsafe\Unsafe\Program.cs 10 31 Unsafe
using System;
class Unsafe
{
unsafe static void SquarePtrParam(int *p)
{
*p *= *p;
}
unsafe public static void Main(string[] args)
{
int i = 5;
SquarePtrParam(&i);
Console.WriteLine(i);
}
}
How to run csc /unsafe *.cs
|
|
|
|
|
if running SCS from the command line, add the switch.
if running Visual Studio, go to Project Properties, and look for "Allow unsafe code" checkbox.
|
|
|
|
|
Deja Vu all over again. The 3rd time this user has asked the same question
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Just found some of his attempts to ask this, earliest one dates August 10[^]!
|
|
|
|
|
That´s the reason why MS made it "difficult" to use unsafe code ...
|
|
|
|
|
|
How kind of him to give you advance notice, so you could perform all necessary research in time...
|
|
|
|
|
Guess they are just trying until getting an answer they like.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have a multithreaded application with a few background thread polling various URLs.
When testing, it often happen that the URL are not working, and if I break on all exception I keep jumping to this annoying thread (and losing track of what I'm currently debugging)
I tried to "freeze" them, but they keep popping up!
Am I missing something?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
|
No, I haven't!
But I will!
Thanks.
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
If this isn't the right place for this question please let me know.
I was playing with one of the samples Multi Y Graph. I added a couple of varibles and execute it 4 different times via mouse click.
The first time through all works as expected. The second time through the x and y axis work correctly but the 3rd and 4th do not.
Can anyone point me in the right direction.
Here is the code I am using...
public partial class Form1 : Form
{
private static int clickCount = 0;
private LineItem myCurve;
public Form1()
{
InitializeComponent();
}
#region Graph Test
public void CreateChart(ZedGraphControl zgc)
{
GraphPane myPane = zgc.GraphPane;
myPane.Title.Text = "Demonstration of Multi Y Graph";
myPane.XAxis.Title.Text = "Time, s";
myPane.YAxis.Title.Text = "Velocity, m/s";
myPane.Y2Axis.Title.Text = "Acceleration, m/s2";
PointPairList vList = new PointPairList();
PointPairList aList = new PointPairList();
PointPairList dList = new PointPairList();
PointPairList eList = new PointPairList();
for (int i = 0; i < 30; i++)
{
double time = (double)i;
double acceleration = 2.0;
double velocity = acceleration * time;
double distance = acceleration * time * time / 2.0;
double energy = 100.0 * velocity * velocity / 2.0;
aList.Add(time, acceleration);
vList.Add(time, velocity);
eList.Add(time, energy);
dList.Add(time, distance);
}
if (clickCount == 1)
{
LineItem myCurve = myPane.AddCurve("Velocity",
vList, Color.Red, SymbolType.Diamond);
myCurve.Symbol.Fill = new Fill(Color.White);
myPane.YAxis.Scale.FontSpec.FontColor = Color.Red;
myPane.YAxis.Title.FontSpec.FontColor = Color.Red;
myPane.YAxis.MajorTic.IsOpposite = false;
myPane.YAxis.MinorTic.IsOpposite = false;
myPane.YAxis.MajorGrid.IsZeroLine = false;
myPane.YAxis.Scale.Align = AlignP.Inside;
myPane.YAxis.Scale.Max = 100;
}
if (clickCount == 2)
{
myCurve = myPane.AddCurve("Acceleration",
aList, Color.Blue, SymbolType.Circle);
myCurve.Symbol.Fill = new Fill(Color.White);
myCurve.IsY2Axis = true;
myPane.Y2Axis.IsVisible = true;
myPane.Y2Axis.Scale.FontSpec.FontColor = Color.Blue;
myPane.Y2Axis.Title.FontSpec.FontColor = Color.Blue;
myPane.Y2Axis.MajorTic.IsOpposite = false;
myPane.Y2Axis.MinorTic.IsOpposite = false;
myPane.Y2Axis.MajorGrid.IsVisible = true;
myPane.Y2Axis.Scale.Align = AlignP.Inside;
myPane.Y2Axis.Scale.Min = 1.5;
myPane.Y2Axis.Scale.Max = 3;
}
if (clickCount == 3)
{
myCurve = myPane.AddCurve("Distance",
dList, Color.Green, SymbolType.Square);
myCurve.Symbol.Fill = new Fill(Color.White);
myCurve.YAxisIndex = 1;
YAxis yAxis3 = new YAxis("Distance, m");
myPane.YAxisList.Add(yAxis3);
yAxis3.Scale.FontSpec.FontColor = Color.Green;
yAxis3.Title.FontSpec.FontColor = Color.Green;
yAxis3.Color = Color.Green;
yAxis3.MajorTic.IsInside = false;
yAxis3.MinorTic.IsInside = false;
yAxis3.MajorTic.IsOpposite = false;
yAxis3.MinorTic.IsOpposite = false;
yAxis3.Scale.Align = AlignP.Inside;
}
if (clickCount == 4)
{
myCurve = myPane.AddCurve("Energy",
eList, Color.Black, SymbolType.Triangle);
myCurve.Symbol.Fill = new Fill(Color.White);
myCurve.IsY2Axis = true;
myCurve.YAxisIndex = 1;
Y2Axis yAxis4 = new Y2Axis("Energy");
yAxis4.IsVisible = true;
myPane.Y2AxisList.Add(yAxis4);
yAxis4.MajorTic.IsInside = false;
yAxis4.MinorTic.IsInside = false;
yAxis4.MajorTic.IsOpposite = false;
yAxis4.MinorTic.IsOpposite = false;
yAxis4.Scale.Align = AlignP.Inside;
yAxis4.Type = AxisType.Log;
yAxis4.Scale.Min = 100;
}
myPane.XAxis.MajorGrid.IsVisible = true;
myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45.0f);
zgc.AxisChange();
zgc.Invalidate();
}
#endregion
private void toolStripButton1_Click(object sender, EventArgs e)
{
if (clickCount > 4 || clickCount == 4)
{
clickCount = 1;
}
else
{
clickCount = clickCount + 1;
}
CreateChart(zgc);
}
}
thanks in advance
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
-- Modified Sunday, December 12, 2010 12:28 PM
|
|
|
|
|
Read How to get an answer to your question[^] and with attention to #7. Following these guidelines will get better responses to your questions
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
thanks for the tip
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Did you find the solution for keeping the size of your GraphPane?
If not, here is it:
You need 2 floats
private float myHeight = 0;
private float myWidth = 0;
and in your CreateChart, right after
GraphPane myPane = zgc.GraphPane;
you add:
if (myHeight == 0)
{
myWidth = myPane.Rect.Size.Width;
myHeight = myPane.Rect.Size.Height;
}
else
{
if (myPane.Rect.Size.Width < myWidth)
{
myPane.Rect = new RectangleF(0, 0, myWidth, myHeight);
}
}
|
|
|
|
|
Thank you Thomas. I was using a different work around but I like this way better.
Thanks again for your time and expertise.
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
Try this in your button click event:
clickCount++;
if (clickCount > 4)
{
clickCount = 1;
zgc.GraphPane = new GraphPane();
}
CreateChart(zgc);
some work with the pane size remains ...
|
|
|
|