• Source
    1. using System;
    2. using System.Collections.Generic;
    3. using System.Linq;
    4. using System.Text;
    5. using System.Threading.Tasks;
    6. using System.Windows;
    7. using System.Windows.Controls;
    8. using System.Windows.Data;
    9. using System.Windows.Documents;
    10. using System.Windows.Input;
    11. using System.Windows.Media;
    12. using System.Windows.Media.Imaging;
    13. using System.Windows.Navigation;
    14. using System.Windows.Shapes;
    15.  
    16. namespace WpfBieden
    17. {
    18. /// <summary>
    19. /// Interaction logic for MainWindow.xaml
    20. /// </summary>
    21. public partial class MainWindow : Window
    22. {
    23. public MainWindow()
    24. {
    25. InitializeComponent();
    26.  
    27. }
    28.  
    29. private void butn1_Click(object sender, RoutedEventArgs e)
    30. {
    31.  
    32. {
    33. //variabelen
    34. string name = txtbox1.Text;
    35. string txtbod = txtbox2.Text;
    36. string bodtxt = txtbox1.Text;
    37. int bod = Convert.ToInt32(txtbod);
    38. int hoogstebieder = 0;
    39.  
    40. if (bod > hoogstebieder);
    41. {
    42. labeltext.Content = $" {name} heeft met {bod} het hoogste bod.";
    43. hoogstebieder = bod;
    44.  
    45. }
    46.  
    47. else
    48. {
    49. labeltext.Content = "Gelieve een postief getal in te voeren.";
    50. }
    51.  
    52.  
    53.  
    54. if (bod > hoogstebieder)
    55. {
    56. labeltext.Content = $" {name} heeft met {bod} het hoogste bod.";
    57. }
    58.  
    59. else
    60. {
    61. labeltext.Content = $" {name} heeft met {bod} het hoogste bod.";
    62. }
    63. }
    64. }
    65.  
    66. }
    67. }
    68.  
    69.