C
C#•2mo ago
Teenie

system project problem

hey everyone! I'm a C# beginner and I'm having some problems on my system code (It's a billing system). Every time I click total, always shows that I need to put a cash amount, idk if this is an window popup error (this also my problem on my login and register password hashing even though I followed it). Does anyone willing to help and teach me how I can fix this? Thanks in advance and have a great day! 😸
16 Replies
ACiDCA7
ACiDCA7•2mo ago
$code
MODiX
MODiX•2mo ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
Pobiega
Pobiega•2mo ago
Show the code for your total button click event handler And maybe a screenshot of the UI, preferably with the error
Teenie
TeenieOP•2mo ago
BlazeBin - jajfmgopkrsa
A tool for sharing your source code with the world!
Teenie
TeenieOP•2mo ago
No description
Pobiega
Pobiega•2mo ago
ok so if (decimal.TryParse(textBox6.Text, out cashReceived)) is failing that means textbox6.Text wasnt a valid number
Teenie
TeenieOP•2mo ago
oh dang
Pobiega
Pobiega•2mo ago
im assuming that the one next to the "cash" button?
Teenie
TeenieOP•2mo ago
yes
Pobiega
Pobiega•2mo ago
well its blank on that screenshot blank is indeed not a valid number
Teenie
TeenieOP•2mo ago
wait so I should put 0 first before I click the total? my mind currently blanking rn I'm so sorry
Pobiega
Pobiega•2mo ago
Sure You could default the value to 0 as well
Teenie
TeenieOP•2mo ago
wait how?
Pobiega
Pobiega•2mo ago
Set the text property on the text box to 0 in the winforms designer Did you write the code btw? Or ai generate it
Teenie
TeenieOP•2mo ago
i wrote it but when i get an error i fix it with ai
leowest
leowest•2mo ago
it would also be better if u check if the Text is empty or null before u use, there is no telling what the user will do such as deleting the input before u try to parse it

Did you find this page helpful?