C# Tutorial 20 Menu Bars

Поделиться
HTML-код
  • Опубликовано: 28 окт 2024

Комментарии • 78

  • @patwicker1358
    @patwicker1358 7 лет назад

    Gold. Derek, what I really like about your videos is that you obviously rehearse and script them. Other then the occasional typo, you never waste my time while you fumble around trying to figure out how to do something. Kudos!!

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you :) Actually I don't script much at all. It probably feels like that because I edit the videos heavily. If you see a 20 minute video it normally started as a 40 minute video.

  • @dragonboyjazz
    @dragonboyjazz 4 года назад

    mr derek bananas, your a legend, i love your tutorials, they are no bs straight to the point, not aiming for 100% efficiency, just working code and simplicity, love it!!!

    • @derekbanas
      @derekbanas  4 года назад +1

      Thank you for the compliment - Mr. Bananas :)

  • @rodmanunderhilliii8198
    @rodmanunderhilliii8198 3 года назад

    I didn't see any other 'homework' being turned in, so here it is. The extra little things to get the menu items to create a New doc, Open the file into the app, and save the file. I'm sure there are better ways, as far as the code, but it works. Thanks Derek, a lot, for the excellent tutorial.
    // MainWindow.xmal



















































    // MainWindowxmal.cs
    // Closes the app
    private void MenuExit_Click(object sender, RoutedEventArgs e)
    {
    this.Close();
    }
    // Opens the open dialog
    private void MenuNew_Click(object sender, RoutedEventArgs e)
    {
    SaveFileDialog saveDlg = new SaveFileDialog();
    if (txtBoxDoc.Text.Count() > 0)
    {
    MessageBoxResult result = MessageBox.Show("Do you want to save this Document?",
    "Confirmation", MessageBoxButton.YesNoCancel);
    if (result == MessageBoxResult.Yes)
    {
    // call MenuSave_Click to save current document, not sure what to put in the arguements, but it works
    MenuSave_Click(0, null);
    // Clear document, making it as new
    txtBoxDoc.Text = null;
    }
    else if (result == MessageBoxResult.No)
    {
    // Clear document, making it as new
    txtBoxDoc.Clear();
    }
    else
    {
    // Cancel code here
    }
    }
    }
    // Opens the open dialog
    private void MenuOpen_Click(object sender, RoutedEventArgs e)
    {
    OpenFileDialog openDlg = new OpenFileDialog();
    if(openDlg.ShowDialog()==true)
    txtBoxDoc.Text = System.IO.File.ReadAllText(openDlg.FileName);
    }
    // Opens the save dialog
    private void MenuSave_Click(object sender, RoutedEventArgs e)
    {
    SaveFileDialog saveDlg = new SaveFileDialog();
    saveDlg.FileName = DateTime.Now.ToString();
    saveDlg.FileName = saveDlg.FileName.Replace(":", "").Replace("/", "-");
    saveDlg.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
    if (saveDlg.ShowDialog()==true)
    {
    System.IO.File.WriteAllText(saveDlg.FileName, txtBoxDoc.Text);
    }
    }
    // Unchecks other fonts and changes font for the text box
    private void MenuFontTimes_Click(object sender, RoutedEventArgs e)
    {
    menuFontCourier.IsChecked = false;
    menuFontArial.IsChecked = false;
    txtBoxDoc.FontFamily = new FontFamily("Times New Roman");
    }
    private void MenuFontCourier_Click(object sender, RoutedEventArgs e)
    {
    menuFontTimes.IsChecked = false;
    menuFontArial.IsChecked = false;
    txtBoxDoc.FontFamily = new FontFamily("Courier");
    }
    private void MenuFontArial_Click(object sender, RoutedEventArgs e)
    {
    menuFontCourier.IsChecked = false;
    menuFontTimes.IsChecked = false;
    txtBoxDoc.FontFamily = new FontFamily("Arial");
    }

  • @vinuhosanagar1
    @vinuhosanagar1 7 лет назад +1

    Thank you Derek. I like your videos before watching it. You are such an awesome person.
    One polite request from my side is please cover MVVM in detail.
    At the end of tutorials If you can do workable application from scratch would be a boon for all of us. Then we will know how an application is developed from scratch. It's my humble request. I know you will have a very tight schedule, But requesting you to keep this in your agenda. :)

    • @derekbanas
      @derekbanas  7 лет назад +3

      Thank you :) Yes MVVM will be covered and I plan on making many applications very soon.

  • @maruatajongte6293
    @maruatajongte6293 7 лет назад +2

    please continue this great works

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you :) Many more are coming

  • @2271masoud
    @2271masoud 7 лет назад

    quality tutorial as usual.
    Thanks Derek

  • @TheSireny
    @TheSireny 6 лет назад

    Hi Derek, first of all, thank you so much for putting the work into these tutorials, they are the perfect help for getting back into coding after a few year hiatus. I remember using Windows Forms to build the GUI for applications, and I was wondering what the difference between that and WPF is, and when is it more suitable to use one as opposed to the other?

  • @jeffreyriggs1911
    @jeffreyriggs1911 7 лет назад

    very cool tutorial!!!! I will be checking this out more in depth... you say you do tutorials based off of request...
    my question - how do you create a menu item that you click and it brings up a new page in the app?
    example is if you have a main page with say info, chart, data, etc.... but you can go to a different page to enter quantities, etc...
    hope you understand that...

  • @scopestacker9787
    @scopestacker9787 7 лет назад

    Derek, when you need a little break between all the C# stuff it would be great to take a look at Kotlin programming language. I was a bit surprised that you haven´t focused on it yet. I already know lots of this C# stuff but I'm watching your videos anyway. Great explained as always!

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you :) Yes I plan on making learn in ones for Kotlin, Elixir and Erlang soon

  • @russianbear54
    @russianbear54 6 лет назад

    If anyone is getting shot with a bazillion "SC1061" errors,, then make sure that the namespace on the code matches whatever you originally named this tutorial as! Wow, it's been killing me for hours until I finally figured it out! If not the actual code and the logic behind it, I'm at least learning attention to detail. :)

  • @riteshkavankar
    @riteshkavankar 4 года назад

    Thank you so much your all efforts😇

    • @derekbanas
      @derekbanas  4 года назад

      I'm very happy to be able to help

  • @andreyborisovich8531
    @andreyborisovich8531 4 года назад

    What about keyboard shortcuts for the InputGestureText implementation?
    Would be nice to have it in the video too. At least some example. But great video thanks!

  • @gianniskim
    @gianniskim 5 лет назад

    it didnt let me use the tool box.. all it is grey.. and cant drag them..what excatly project you use? maybe this is the issue

  • @thomasa.harrisiii906
    @thomasa.harrisiii906 7 лет назад

    Hey Derek, i'm having a small issue with my code for as i'm trying to make multiple pop up windows in one activity using Android Studio. I'm pretty sure its a rather simple fix but i'm a bit of a novice even for my small app lol. Would you be able to help? I also have my code if need be
    Thanks in advance

  • @orochinagi1111
    @orochinagi1111 7 лет назад +3

    this series is kicking so much @rse!! thank you so much!

    • @derekbanas
      @derekbanas  7 лет назад

      I'm very happy you like it :)

  • @Ahmed-wj5sd
    @Ahmed-wj5sd 7 лет назад +1

    Hi Derek, do you consider to do videos about shaders?

    • @derekbanas
      @derekbanas  7 лет назад +2

      Hi, I could, but I want to cover how to make games using Unity and MonoGame first. I'll cover shaders and lighting when I get into C++

  • @7531PETER
    @7531PETER 7 лет назад

    GOLD! ... How do you best memorize all the options C# has to use - particularly WPF for example?

    • @derekbanas
      @derekbanas  7 лет назад +2

      Thank you :) Write lots of programs and you'll remember what you need naturally

    • @7531PETER
      @7531PETER 7 лет назад

      Derek Banas will do, thanks =∆

  • @element74
    @element74 7 лет назад

    quick question... do I need to watch all your c# videos, if i plan to develop ios apps? Still new to programming myself.

    • @derekbanas
      @derekbanas  7 лет назад

      No I'm just doing my best to cover everything you can do with C#. I've covered everything you need to move on to Xamarin already

  • @stevefrt9495
    @stevefrt9495 6 лет назад

    nice job thanks you so much Derek

  • @bit_FLIP
    @bit_FLIP 7 лет назад

    Protip: Try docking the XAML to the right side (click Vertical Split) . It's a game-changer

  • @sandeepvk
    @sandeepvk 7 лет назад

    Derek, I tried Meteor but there are so many packages to run it its overwhelming. Isn't there any full stack framework with build in router and package to simply launch a web app

  • @a.b_shots
    @a.b_shots 7 лет назад

    Marvelous tutorial thank you. :)

  • @RP-mp4ow
    @RP-mp4ow 5 лет назад

    Gold.
    Thank you!

  • @deryaateskaya6929
    @deryaateskaya6929 6 лет назад

    I really love your videos.. Thanks much..

  • @GammerAdam
    @GammerAdam 7 лет назад +1

    Hi Derek!
    Really love your videos, thank you for your hard work to spread the knowledge of Code!
    (yep that's a new-age religion)

    • @derekbanas
      @derekbanas  7 лет назад

      That's funny :) You're very welcome. I'm happy they help

  • @avhd187
    @avhd187 7 лет назад

    Is this only possible with Windows? Can you take the same code and produce that on Mac?

  • @saajid6149
    @saajid6149 7 лет назад

    I understand ur videos they r awesome..but Can't remember all those stuff from ur videos!Do I need to??

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you :) No don't memorize it. Just use the cheat sheets I provide and copy and paste.

    • @saajid6149
      @saajid6149 7 лет назад

      Thanks derek

    • @simrandotdev
      @simrandotdev 7 лет назад

      My recommendation is spend an hour on a 20 minute video. Watching + Coding.
      As Derek has a great schedule. Wednesdays and Saturdays.
      Watch Wed video on Wed + code
      Watch Sat video on Sat + code.
      Watch Both videos on Sunday + code Both.
      And Experiment the days in between.

  • @taruntarun05
    @taruntarun05 4 года назад

    can you please write MVVM version of this ?

  • @vinuhosanagar1
    @vinuhosanagar1 7 лет назад

    Can you pls tell me Which is the best book to learn WPF?

    • @derekbanas
      @derekbanas  7 лет назад +1

      The online documentation is great

    • @pinguincoder
      @pinguincoder 7 лет назад +1

      go to www.wpftutorial.net. Best site I know for learning WPF

  • @mohammadowais9314
    @mohammadowais9314 7 лет назад

    Thanks again @derek
    U the best

  • @kyagos1839
    @kyagos1839 7 лет назад

    I love this language and your tutorials!
    Going into WindowsForms was a pain, but the WindowsPresentationFoundation is awesome and despite some bugs, not working features and hidden features you might never find a very dynamic form of .NET Application.
    I have a very special request since someone might know an answer and this is highly advanced.
    The RMI function from Java can run as a Client-Server or ClientProcess-ClientProcess Communication. It is said that RMI was kind of implemented into the .NET Framework. (don't mean DLL)
    Can you say how to create a WPF that triggers processes of another local WPF or Console Application?
    You might ask why. Answer is that the Application uses functions that require administrative rights but the Client Application that is used by the Users is just allowed to run with restrictions. So the application is divided into ViewAndTriggerApplication and ServiceApplication.
    Internet is full of Client-Server RMI but I am not able to reproduce it to this request.

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you :) Sorry, but I don't see how you can do what you mentioned because of security issues.

    • @kyagos1839
      @kyagos1839 7 лет назад

      Derek Banas Predefined Functions in Application with admin level triggered by application with restricted level. Shouldn't this be the secure way compared to simply one application run directly as an administrator?!

  • @stillww
    @stillww 7 лет назад +2

    I'm having flashbacks to the Visual Basic tutorials while watching this...

    • @derekbanas
      @derekbanas  7 лет назад +1

      Yes this part is very similar and I like that :)

    • @stillww
      @stillww 7 лет назад

      It's nice to see the similarities and differences between Winforms and WPF so I appreciate the way you've done it :)

  • @SunnyApples
    @SunnyApples 7 лет назад

    Thank you for the video!
    I have a small question. On my Visual Studio 2017, XAML code is not color formatted (blue like yours), it's all plain white text. Is this something that is easily fixed?

    • @derekbanas
      @derekbanas  7 лет назад

      You're very welcome :) They show you how to set syntax coloring here msdn.microsoft.com/en-us/library/aa265717(v=vs.60).aspx

  • @patwicker1358
    @patwicker1358 7 лет назад

    Your code starts with "public partial class MainWindow :Window" what does the "partial" do?

    • @jeffmerlin2580
      @jeffmerlin2580 7 лет назад

      Pat Wicker it means it's part of a class. :-)

    • @patwicker1358
      @patwicker1358 7 лет назад

      So it means the class is also defined somewhere else and we are just adding to that definition?

    • @jeffmerlin2580
      @jeffmerlin2580 7 лет назад

      Pat Wicker Yes. The class is pretty complex. We're just adding small parts to it. I believe the class is the window/dialog.

    • @patwicker1358
      @patwicker1358 7 лет назад

      Got it thank you, that is a cool feature.

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you for helping :)

  • @Starname64
    @Starname64 7 лет назад

    Gold

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you for doing that :)

  • @hu._
    @hu._ 7 лет назад

    Hi dude pls can u make video how to make datagridview backcolor and row backcolor = fromargb(150,0,0,0) pls pls pls and thanks , me and 4 other guys wait u to upload how to make it

    • @derekbanas
      @derekbanas  7 лет назад

      Sure I'll try to cover that soon. Thank you for the request :)

    • @hu._
      @hu._ 7 лет назад

      Ah and in vb.net if u can pls :) and thank u so much :*