- Jul 28, 2015
- 2,495
- 571
- 136
Figured I'd give some C# a shot, since Lazarus GUI wasn't all that pretty, and because why not. I've sort of got a nice gui going, but one thing that just murders readability, is having more-than-two lines of code in a gui event-type-thing, or whatever they're called.
Me question, is how would I decouple most of me code frae the gui? In Pascal, you can just have another .pas file in the same folder, type "uses WhateverTheOtherPascalFileIsCalled" at the beginning of your code, then you just call WhateverTheFuncThisIs(), which is a function in the...err, resource file?
That's the sorta thing I want to do in Visual Studio. For a real-world example, here's me Form1.cs file. http://pastebin.com/fBK6Qj20
The main piece of code in question, is this part:
What I want to do, is put that huge arse if statement in a separate .cs file, probably called through something like myResizeAllCheck(). What do and how?
Also, the hell does "private" mean anyhow? All the programming sites 'n' google results speak in that pretentious gobble-dee-beloved patriot that requires you to know what it already is in order to know what it is. I swear, programmers are worse than the guy that designs IKEA's furniture manuals.
Me question, is how would I decouple most of me code frae the gui? In Pascal, you can just have another .pas file in the same folder, type "uses WhateverTheOtherPascalFileIsCalled" at the beginning of your code, then you just call WhateverTheFuncThisIs(), which is a function in the...err, resource file?
That's the sorta thing I want to do in Visual Studio. For a real-world example, here's me Form1.cs file. http://pastebin.com/fBK6Qj20
The main piece of code in question, is this part:
Code:
private void checkboxDoResizeAll_CheckedChanged(object sender, EventArgs e)
{
if (checkboxDoResizeAll.Checked)
{
checkboxDoResize01.Checked = true;
checkboxDoResize02.Checked = true;
checkboxDoResize03.Checked = true;
checkboxDoResize04.Checked = true;
checkboxDoResize05.Checked = true;
checkboxDoResize06.Checked = true;
checkboxDoResize07.Checked = true;
checkboxDoResize08.Checked = true;
checkboxDoResize09.Checked = true;
checkboxDoResize10.Checked = true;
checkboxDoResize11.Checked = true;
checkboxDoResize12.Checked = true;
checkboxDoResize13.Checked = true;
checkboxDoResize14.Checked = true;
checkboxDoResize15.Checked = true;
}
else
{
checkboxDoResize01.Checked = false;
checkboxDoResize02.Checked = false;
checkboxDoResize03.Checked = false;
checkboxDoResize04.Checked = false;
checkboxDoResize05.Checked = false;
checkboxDoResize06.Checked = false;
checkboxDoResize07.Checked = false;
checkboxDoResize08.Checked = false;
checkboxDoResize09.Checked = false;
checkboxDoResize10.Checked = false;
checkboxDoResize11.Checked = false;
checkboxDoResize12.Checked = false;
checkboxDoResize13.Checked = false;
checkboxDoResize14.Checked = false;
checkboxDoResize15.Checked = false;
}
}
What I want to do, is put that huge arse if statement in a separate .cs file, probably called through something like myResizeAllCheck(). What do and how?
Also, the hell does "private" mean anyhow? All the programming sites 'n' google results speak in that pretentious gobble-dee-beloved patriot that requires you to know what it already is in order to know what it is. I swear, programmers are worse than the guy that designs IKEA's furniture manuals.