The only way I can think of is to translate the points of the path into points on the coordinate plane. Then you could calculate the line of best fit. Using the slope of the line of best fit you could find the diagonality of the path if you know where the line starts (perfect diagonality would be a slope of -1 in this case).

I have not put much thought into it, this is just the first idea that popped into my head.

I have an image with a white background and I want the white area of the image to be transparent, but if I set the form's Transparency Key I can see through the form where the white area of the picture was. Is there any way to only make the picture transparent, not the form? Any help is appreciated.

I am creating a simple program where a character (Picture Box) is moved using the arrow keys through adjusting the x and y. I have figured out how to detect key presses and adjust the x and y, but I cannot figure out how to redraw the picture box so that it moves. I have used Google but none of the answers are working. Any help is appreciated.

Copy the code from Case 'M'.
And add this below that case:
[CODE]
Case 'm':
//Code From Case 'M'
break;
[/CODE]

Can't you just set the forms to the same size and then set the Transparency Key of the top form to the background color? That should work...

I need to simulate a mouse click, but I need it to simulate a click that will effect the open window (In this case the browser). Is there an easy way to do this or is it not possible? Any help is appreciated.

If I was you, I would go back and start the project from scratch again with a different approach.

However be sure to use arrays the size of the "numrolls" and then use a foreach.
[CODE]
int[] numrollsArray = new int[numrolls];
foreach (int i in numrollsArray)
{
}
[/CODE]

[CODE]
switch (number)
{
case 1:
Console.WriteLine("I");
break;
case 2:
Console.WriteLine("II");
break;
}
[/CODE]

Much better than if/else for more than 3 statements.

I need to draw a thick line between two Picture Boxes using code. Is there an easy way to do this, possibly similar to drawing a rectangle or circle? Any help is appreciated.

Thanks that worked perfectly.

However, I cannot seem to find a C++ equivalent to this?
How would I do this, or is it just not possible? Any help is appreciated.

CTRL+C stores the selected item to the Clipboard, which has a class.
[CODE]Clipboard.SetText("Text You Want Copied");[/CODE]

CTRL+C stores the selected item to the Clipboard, which has a class.
[CODE]Clipboard.SetText("Text You Want in Clipboard");[/CODE]

Sorry, should have used Google before my last post. Thanks for the help, thread solved.

How would I remove it from the list? Because that would be just as good.

I need to disable the 2nd item in a comboBox when something happens. How would I go about doing this? Any help is appreciated.

Thanks Sodabread, that was exactly what I was looking for. This is just another quick question. Is there anyway I can write some text on to the console, and then change that text to something else?

I would like to write a string (s) to a line in the console. But instead of having the blinking underscore on the next line, I want it next to the string I just wrote to the console. In C++ it would be:
[CODE]
cout << s; cin.ignore();
[/CODE]

samuael, that worked perfectly however how would I still write text on that line?

I am currently working on a game that takes place in the console. I need to know how to combine [CODE]Console.WriteLine()[/CODE] and [CODE]Console.ReadLine()[/CODE] into 1 line so that the blinking underscore appears on the same line. Is there any way to do this? Any help is appreciated.

I just though of an easier way that requires less work and a little less code.
[code]
average = .280 * 1000;
Random r = new Random();
int hitChance = r.Next(1,1001);
if (hitChance < average+1)
{
//Hit
}
else
{
//Out
}
[/code]
This should be a little easier because you avoid fractions and there is more consistency between the code for each player.

My idea, which is most likely the long and hard way, would be to convert the average to a fraction. .280 = 7/25. I would then try this:
[CODE]
Random r = new Random();
hitChance = r.Next(1,26);
if (hitChance < 8)
{
// Hit Code
}
else if (hitChance > 7)
{
// Out Code
}
[/CODE]

This would be my way of going about this, however I am new to C# and relatively new to programming so you may want to ask a more senior programmer/poster.

I am making a game that requires a rectangle to stay with the cursor position on the X-axis, but only move at a certain speed. How would I do this? Any help is appreciated.

When I try that I get the error message: "System.Random does not contain a definition for 'next' and does not contain an extension method 'next' accepting a first argument of type 'System.Random' could be found (are you missing a using directive or an assembly reference)". Any ideas on how to fix this?

I created a .txt file with 20 lines of text. I need to read a random line. This code works for the most part:
[CODE]
Random r = new Random();
rand = r.Next(0,20); //rand is a predefined variable
"\n");
string[] arrLines = strAllFile.Split(new char[] { '\n' });
[/CODE]
Everything works except for occasionally I will get an error that "The index is outsides the bound of the array." Every other part of the code works. Can anyone find the issue? I believe it is that the "arrLines" max index is less than 20 and so if the random value is over "arrLines" max I could get this error. If this is true, how would I fix this?

Thanks Momerath, that was exactly what I was looking for.

When I tried that it just printed this: "variable".
Is there anyway I can get it to print a string where the word 'variable' is?

I use a Form to gather Input from the user, and my program needs to format the info and show it in a Text Box. Everything works except 2 of my variables need to look like this in the output: "variable".

The problem is that I can't find a way to make the variable write with quotations around it. Is there a simple solution to my issue, or am I going to have to find a way around using quotations?

It works great. Thanks for the help!

I am building a simple program with 3 Forms. The first Form has 2 Buttons and the other 2 are blank. I used this code:
[CODE]
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
button2.Click +=new EventHandler(button2_Click);
button1.Click +=new EventHandler(button1_Click);
}

``````    private void button2_Click(object sender, EventArgs e)
{
Form3 a = new Form3();
a.Show();
}

private void button1_Click(object sender, EventArgs e)
{
Form2 b = new Form2();
b.Show();
}
}``````

[/CODE]
When Button 1 is clicked, Form 2 should open. And when Button 3 is clicked Form 3 should Open. Although the forms open when the button is clicked, but when they open it opens 2 identical Form 2 or Form 3 windows. I cannot seem to find the problem. Is the issue in the way I tell my Forms to open?