Here is my Form class' constructor:
DrawingSurface is a class, Color is a structure.
When I change any of ds's members they change the original members.
Now, I know that all classes are passed by ref but I thought that to change the members permanantly you had to pass the class by ref. That is the first issue.
The second is the real mind boggler, and frustrator. In the OptionsForm, I have a variable that is global and is initialized in the constructor to the transpCol variable.
Later in the Form I set this.transpColor to a color value, which should change the value of the variable passed in the constructor, but it does not! However, if, in the constructor I change the value
it does change the color of the variable passed!
Am I not understanding something? Here is the top part of OptionsForm:
C#:
public OptionsForm(a.graphics.DrawingSurface ds, ref Color transpCol)
When I change any of ds's members they change the original members.
Now, I know that all classes are passed by ref but I thought that to change the members permanantly you had to pass the class by ref. That is the first issue.
The second is the real mind boggler, and frustrator. In the OptionsForm, I have a variable that is global and is initialized in the constructor to the transpCol variable.
C#:
this.transpColor= transpCol;
C#:
this.transpColor= Color.Black;
Am I not understanding something? Here is the top part of OptionsForm:
C#:
public class OptionsForm : System.Windows.Forms.Form
{
public Color transpColor= Color.Empty;
private System.ComponentModel.Container components = null;
public OptionsForm(a.graphics.DrawingSurface ds, ref Color transpCol)
{
InitializeComponent();
this.transpColor= transpCol;
}