❔ Can someone help me with the buttons?
The buttons doesn’t work in my cookbook. Can someone’s help me?
187 Replies
let me see here...
ah!
the issue is that you didn't do the thing that makes them work!
here you go: just do the thing that will make them work
hope that helps!
$details
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
When I click the Ok Button it does not do anything, I want it to do what I want it to do
make it do it
How?
can't tell you because you didn't provide enough detail
what ui framework? what code do you have now? what have you tried to fix it?
@Bad Victory do not send unsolicited DMs to people in this server, the place for help is in this post
Eehhh
How else am I supposed to show you?
by posting it... here?
there's no guarantee i can fix what's wrong, and you will want someone else to be able to jump in if they know more than me
How?
$details
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
How does it work?
have you considered just
clicking the link
I did
What do I do now?
... do you not see the buttons in the top left?
What do they do?
can't tell if you're trying to waste our time, or just refuse to even try to help yourself and/or explore
I just want to do it right
I promise your computer will not explode if you try clicking them
lol where is your UI buddy?
i think they're more confused on what exactly to paste
Even a screenshot might suffice
The buttons didn’t do anything
What buttons? 👀
The ones at top left
top left where? 👀
BlazeBin
A tool for sharing your source code with the world!
this is a generic link, you need to share the link that has your code
How does it get my code?
heard of github?
you can upload your code onto it 😄
Oh, I got that
you can share a repo
you can also just
copy and paste
Or that..
make sure you put it in
How do I do that?
using three `'s
S?
it's this symbol: `
Where is it?
top left of your keyboard under escape
I see it
it turns out, that command from earlier tells you another command to use to get more information
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/Why doesn’t anything happen?
Did I do it wrong?
are you trolling? honestly..
No
I am trying to tap the button
<:picard_facepalm:616692703685509130>
Star Trek
are you trying to code from your phone?
No
forget the paste website, just do that for now ^
Do what?
i give up
gebz#7155
Quoted by
<@!142682996674134016> from #Can someone help me with the buttons? (click here)
React with ❌ to remove this embed.
do this:
What is that?
have you used discord before?
Yes
it's
just type it in
Man, you're intentionally wasting our time
this
you can see the image right
the one with the ``` characters?
🍿
Wait, can we start over? I am confused
```\ your code ```\
just forget all of it, copy and paste your code as is
this is taking way too long to explain
at this stage i'm not even sure whether they have code at all
It say it is too big
then upload it to some paste website and share the link to that
there's a 2000 character limit
or just upload the whole .cs file(s)
BlazeBin - jqetpomnurgz
A tool for sharing your source code with the world!
Like this?
yes
so which part isn't working
The Ok button
you don't have any code in that handler
it's not doing anything because you aren't telling it to
you have to tell the thing to do stuff in order for the thing to do stuff
I tried but it just said error
i guarantee it didn't just say "error"
explain exactly what you tried and what the exact error was
I typed "close the window"
It did not work
...
if you don't start giving details, people are going to start leaving this thread and blocking you
I know I'm tempted
don't make helping you like pulling teeth
yeah i'm sorry but this seriously seems like trolling
do you expect to write plain english into a piece of code and have it work?
Why?
just give details
It was what some told me
It is supposed to add the ingredients
.NET documentation
Learn to use .NET to create applications on any platform using C#, F#, and Visual Basic. Browse API reference, sample code, tutorials, and more.
where did the rest of the code come from? because i don't think you wrote it based on these questions
I did
might have just been a chatGPT copy pasta
so you understand that C# has specific syntax rules you have to follow
Can that do it?
you should definitely not use chatgpt at this point
Ok
There's some excellent C# courses on youtube
freeCodeCamp.org
YouTube
C# Tutorial - Full Course for Beginners
This course will give you a full introduction into all of the core concepts in C# (aka C Sharp). Follow along with the course and you'll be a C# programmer in no time!
⭐️ Contents ⭐️
⌨️ (0:00:00) Introduction
⌨️ (0:01:18) Installation & Setup
⌨️ (0:05:03) Drawing a Shape
⌨️ (0:17:23) Variables
⌨️ (0:30:06) Data Types
⌨️ (0:37:17) Working With S...
yeah right now i'd suggest just starting from zero with a basic tutorial
it's going to be very hard for you to get help if you don't understand the basics of the language
I recommend this https://csharpplayersguide.com/
I skimmed the freecodecamp video and was... not impressed
I was just sharing one of many examples
So, what should I write?
@Bad Victory you need guided intro material, to be blunt
i'm not going to just give you the answer, because if i did you wouldn't understand it
you are clearly missing some fundamentals
here's the official one from the dotnet foundation: https://www.youtube.com/watch?v=Z5JS36NlJiU
dotnet
YouTube
C# for Beginners | Full 2-hour course
C# is a powerful and widely used programming language that you can use to make websites, games, mobile apps, desktop apps and more with .NET. In this video, we'll teach you all the basics of C# and show you how to build a bank account.
Get the .NET Interactive Notebooks and follow along at home: https://aka.ms/csharpnotebooks
Free self-guided ...
pick up a book, C# Player's Guide is good
Couldn't I just show the code?
i think i have that in a box, never actually read it
you need to learn
this isn't just a simple question, you're struggling with fundamentals
find some intro material, book, video series, doesn't matter
it's also a school assignment, so you should ask your teacher for help
He isn't answering
i just noticed
going to guess your teacher expects you to ask for help given
//Ask for help to check the status of your programming - project
What is it with that?
can you explain what it does to me?
It gets the MaxNumOfIngredients and returns it
from where?
From MaxNumOfIngredients
and where does that get it from?
From MaxNumOfIngredients
and where does that get it from? (do you see where i'm going with this)
From MaxNumOfIngredients
I can't tell if you're pulling our leg, or don't see how this is circular
I see it is circular
so if you actually tried to get the value of
MaxNumOfIngredients
, it would crash with a stack overflow
because it tries to get the value of itself infinitelyHow do I fix that?
return the value of another field/property
or just make it an auto-property
What field?
one you would make to store the max number of ingredients
Which one is that?
i'm going to have to ask you to try and think of the answer yourself before asking these questions
i won't spoonfeed the entire answer because you won't learn anything, if you're this stuck you should try to get help in class because i don't know where you're supposed to be in your learning
It still does not work
i can't do anything with that information
What do you want to know
think about what i might need to know to be able to help you
private void btnOK_Click(object sender, EventArgs e)
{
int index = lstIngredients.SelectedIndex;
}
okay, what do you expect that to do
and what is it actually doing?
Make it work
again, that is completely unspecific
what do you want to happen when you click OK
and how does that line of code help you get there?
I want it to add the ingedients to txtBoxDescription
okay, so what does the line of code you added do
How do I know that?
you wrote it, you should know what it does
if you don't, you need to figure it out
you won't get anywhere by copying and pasting random pieces of code, you need to actually understand what you're doing
It is supposed to add the ingredients to txtBoxDescription
and how does it do that?
where is
txtBoxDescription
in that code?private void AddRecipe()
{
// Get the properties from currRecipe for example "Name"
currRecipe.Name = txtBoxRecipeName.Text;
// Do similar for other properties Description and FoodCategory from currRecipe.
currRecipe.Description = txtBoxDescription.Text;
currRecipe.FoodCategory = (FoodCategory)Enum.Parse(typeof(FoodCategory), cmbBoxCategory.Text);
// Check if txtBoxRecipeName is not null
if (txtBoxRecipeName != null)
{
// Call the method AddRecipe from recipeManager to add currRecipe
recipeManager.AddRecipe(currRecipe);
}
}
that is completely different code
i need to go to bed, and you seriously need to review your notes or go through an intro C# tutorial instead of blindly copying code around and expecting something to just start working
you cannot write programs if you don't understand what you're writing
@Bad Victory Let's start with: What are you using to create this app? Winforms, WPF, Xamarin Forms? 2nd how are you creating the button and 3rd how are you trying to capture when they click on the button?
Winforms: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.button?view=windowsdesktop-7.0
WPF: https://www.tutorialspoint.com/wpf/wpf_buttons.htm
Xamarin.Forms: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/button
Button Class (System.Windows.Forms)
Represents a Windows button control.
WPF - Buttons
WPF Buttons - The Button class represents the most basic type of button control. The hierarchical inheritance of Button class is as follows −
Xamarin.Forms Button - Xamarin
The Button responds to a tap or click that directs an application to carry out a particular task.
Do a little searching before you ask for help, I found all of those within a few minutes
Visual
Visual Studio? The question was what framework, not what IDE
C#
What do you mean by
Visual
that gives me no information at all
Framework not languageMicrosoft Visual
What do you mean
Right okay, look at my questions and answer those.
What is Framework?
Winforms, WPF, Xamarin Forms these for example
@Bad Victory
I think this is a troll, how does this server normally deal with such behaviour?
Let's get some moderators
$help
How to get the best help
Make a post in #help or one of the topic channels under Development.
Avoid asking Can anybody help Has anyone used Why doesn't my code work?
C# is a big area! No one knows they can help unless you tell them about the small area you're trying to work in.
Explain what you are doing, and potentially why for as much context as possible. Avoid screenshots where possible, share code directly in Discord. Type
$code
into chat to learn how to post code.
See https://www.nohello.net and https://dontasktoask.com if you want common help chat room etiquette.No $commands
Damn it
I don't know how to get a moderator
I'll ping an online mod
I have created a ticket.
has been quite the read
I get the impression that the assessment of "missing fundamentals" is fairly correct
$helloworld
Written interactive course https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/tutorials/
Videos https://dotnet.microsoft.com/learn/videos
@Bad Victory I'd probably go through one of these
with that said I don't think there's anything productive that's going to come out of this at this point
All that just for a button? Can’t anyone just tell me what to do?
if you want it to go in one ear and out the other? sure
we potentially could
but what good would that really do you
the thing is its also already been explained why your button doesn't work
its because its not been programmed to do anything
if you just want an answer and to not really fill in the gaps, then sure maybe one of us could figure out the exact code you'd need with the right information
but like
is that really what you want?
surely you would like to have a proper understanding of how this stuff works?
😅
How do I fix it?
you'd have to get the item out of the ingredients list at the selected index
then assign the string to the Text property of your textbox
basically
right now you're only getting the index but then doing nothing with it
What does that look like?
¯\_(ツ)_/¯
I don't do winforms
so don't really remember
last time I touched it was like 6 years ago
if you look at the microsoft documentation though it should show you what methods and properties do which things
Can you DM me?
no
sorry
I have my DMs turned off as the server owner
its basically the only private space I have left lol
How else am I supposed to show you?
How cannrun it i here?
um
what?
I found my old GitHub
GitHub
GitHub - TheSupremeMaster/Recipe
Contribute to TheSupremeMaster/Recipe development by creating an account on GitHub.
uhhh
Can you run it and see what is wrong?
I mean
I've already specified your issue
I'm not super equipped to help with winforms stuff specifically though
like, there's a whole documentation page on the stuff you can follow
Right I see you're using Winforms so this may help you: https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.button?view=windowsdesktop-7.0
Button Class (System.Windows.Forms)
Represents a Windows button control.
Please next time, just say what framework you're using
I need to step out, the game studio I work for's gonna wonder where the hell I've gone if I'm not back soon
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.