hugheselite
hugheselite
CC#
Created by hugheselite on 11/6/2024 in #help
How to pass a caught error from one .cs file to output in a textbox in another .cs file? (same sln)
I have two classes that i'm working with. I'm trying to catch an error in one class and output that to a textbox that exists in another class. In my example I'm trying to make my Circle method throw a caught error to my ErrorOutputWindow in my windows form called BooseForm. I think this is a pretty simple implementation but I may be wrong? All help appreciated, thank you!
4 replies
CC#
Created by hugheselite on 1/18/2024 in #help
✅ Can't seem to draw on bitmap after saving it and loading it back to windows form
I can't quite seem to understand the issues here, when I load my saved bitmap back to my windows form I lose the ability to draw on it (shapes etc) I have a few classes going on here so i'll share the link to my repo https://bitbucket.org/110794-main-workspace/ase-component-1/src/master/ Thank you! any help appreciated
4 replies
CC#
Created by hugheselite on 12/13/2023 in #help
✅ My project isn't working when I run a while loop...
{
if (youSuck == You dont suck)
}
else
{
none
}
{
if (youSuck == You dont suck)
}
else
{
none
}
3 replies
CC#
Created by hugheselite on 11/23/2023 in #help
✅ Help with unit testing a save function on a simple windows form app
For some reason my unit test for my save function isn't writing any text to a text file (to ensure the text actually has been saved) i'm getting the error string.empty when trying to execute the Nunit Test
21 replies
CC#
Created by hugheselite on 11/21/2023 in #help
✅ else statement executing regardless of whether I want it to or not, windows form app
I've created a simple windows form app to create shapes on a bitmap, I have a function that gives an error if the user inputs an invalid input. it's currently executing even if the input is valid.. I'm pretty sure it's a simple fix would just appreciate an extra pair of eyes on this one lol
54 replies
CC#
Created by hugheselite on 11/19/2023 in #help
✅ I can't get my runButton button to work on a windows form app
No description
5 replies
CC#
Created by hugheselite on 11/17/2023 in #help
✅ Help with creating shapes on a windows form app
I have created a windows form app to display shapes on a bitmap, my circle function works fine but my rectangle will work regardless of the text I put in, for example..
circle 40
circle 40
will draw a circle with a radius of 40 as it should
bingbong 30,20
bingbong 30,20
will still draw a rectangle even though the string is incorrect
else if (CommandSplit[0].Equals("rectangle") == true) ; /// RECTANGLE FUNCTION

{
try
{
ParameterSplit = CommandSplit[1].Split(",".ToCharArray());

int width = int.Parse(ParameterSplit[0]);
int height = int.Parse(ParameterSplit[1]);
ErrorHandlingWindow.Clear();

MyCanvass.DrawRectangle(width, height);
Refresh();
return;
}

catch (FormatException)
{
ErrorHandlingWindow.Text = FormatExceptionErrorMessage;
return;
}
catch (IndexOutOfRangeException)
{
ErrorHandlingWindow.Text = IndexOutOfRangeExceptionMessage;
return;

}
else if (CommandSplit[0].Equals("rectangle") == true) ; /// RECTANGLE FUNCTION

{
try
{
ParameterSplit = CommandSplit[1].Split(",".ToCharArray());

int width = int.Parse(ParameterSplit[0]);
int height = int.Parse(ParameterSplit[1]);
ErrorHandlingWindow.Clear();

MyCanvass.DrawRectangle(width, height);
Refresh();
return;
}

catch (FormatException)
{
ErrorHandlingWindow.Text = FormatExceptionErrorMessage;
return;
}
catch (IndexOutOfRangeException)
{
ErrorHandlingWindow.Text = IndexOutOfRangeExceptionMessage;
return;

}
19 replies