Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
AnswerRe: method and parameters Pin
OriginalGriff8-Mar-18 23:56
mveOriginalGriff8-Mar-18 23:56 
GeneralRe: method and parameters Pin
Member 137173709-Mar-18 0:19
Member 137173709-Mar-18 0:19 
GeneralRe: method and parameters Pin
Richard Deeming9-Mar-18 0:36
mveRichard Deeming9-Mar-18 0:36 
GeneralRe: method and parameters Pin
Member 137173709-Mar-18 0:47
Member 137173709-Mar-18 0:47 
GeneralRe: method and parameters Pin
OriginalGriff9-Mar-18 1:24
mveOriginalGriff9-Mar-18 1:24 
AnswerRe: method and parameters Pin
#realJSOP9-Mar-18 6:20
mve#realJSOP9-Mar-18 6:20 
AnswerRe: method and parameters Pin
Luc Pattyn9-Mar-18 9:20
sitebuilderLuc Pattyn9-Mar-18 9:20 
AnswerRe: method and parameters Pin
BillWoodruff10-Mar-18 18:43
professionalBillWoodruff10-Mar-18 18:43 
I assume there is a reason you defined the Enum used here; however, it makes no sense to use an Enum as a counter when you allow its value to go outside of the range for which you have defined Enum members.

Assumming you wish the Enum to define the range of "legal" counter values:
// note: I have not tested this code ... I don't use WPF; but, I am confident this is valid. 

namespace Whatever
{
    public enum Verdieping
    {
        kelder = -1,  // you could omit this
        gelijksvloers,
        een,
        twee,
        drie
    }

    public partial class MainWindow : Window
    { 
        private int tally;

        public MainWindow()
        {
            InitializeComponent();

            lblHuidigeVerdieping.Text = Verdieping.gelijksvloers.ToString()};

            tally = 0;
        }

        private void TallyButtons_Click(object sender, RoutedEventArgs  e)
        {
            if (sender.Equals(btnDown))
            {
                if (tally == (int)Verdieping.gelijksvloers)
                {
                    // throw an error ?
                    // show a dialog ?
    
                    return;
                }
    
                tally--;
            }
            else
            {
                if (tally == (int) Verdieping.drie)
                {
                    // throw an error ?
                    // show a dialog ?
    
                    return;
                }
    
                tally++;
            }

            lblHuidigeVerdieping.Text = tally.ToString();
        }
    }
}

«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12

QuestionWPF: Groupbox background image Pin
Hervend8-Mar-18 19:12
Hervend8-Mar-18 19:12 
AnswerRe: WPF: Groupbox background image Pin
Richard MacCutchan8-Mar-18 20:58
mveRichard MacCutchan8-Mar-18 20:58 
QuestionEditing text in body of email via Outlook add-in Pin
Rakanoth8-Mar-18 0:03
Rakanoth8-Mar-18 0:03 
GeneralRe: Editing text in body of email via Outlook add-in Pin
Richard MacCutchan8-Mar-18 0:08
mveRichard MacCutchan8-Mar-18 0:08 
GeneralRe: Editing text in body of email via Outlook add-in Pin
Eddy Vluggen8-Mar-18 0:13
professionalEddy Vluggen8-Mar-18 0:13 
GeneralRe: Editing text in body of email via Outlook add-in Pin
Richard MacCutchan8-Mar-18 0:15
mveRichard MacCutchan8-Mar-18 0:15 
GeneralRe: Editing text in body of email via Outlook add-in Pin
Eddy Vluggen8-Mar-18 0:21
professionalEddy Vluggen8-Mar-18 0:21 
AnswerRe: Editing text in body of email via Outlook add-in Pin
Eddy Vluggen8-Mar-18 0:24
professionalEddy Vluggen8-Mar-18 0:24 
AnswerRe: Editing text in body of email via Outlook add-in Pin
Rakanoth8-Mar-18 22:48
Rakanoth8-Mar-18 22:48 
Questionhow can i set windows form over other programs at the desktop in c# Pin
galba20185-Mar-18 22:11
galba20185-Mar-18 22:11 
AnswerRe: how can i set windows form over other programs at the desktop in c# Pin
OriginalGriff5-Mar-18 22:31
mveOriginalGriff5-Mar-18 22:31 
AnswerRe: how can i set windows form over other programs at the desktop in c# PinPopular
Eddy Vluggen6-Mar-18 1:10
professionalEddy Vluggen6-Mar-18 1:10 
GeneralRe: how can i set windows form over other programs at the desktop in c# Pin
galba20186-Mar-18 2:00
galba20186-Mar-18 2:00 
GeneralRe: how can i set windows form over other programs at the desktop in c# Pin
Eddy Vluggen6-Mar-18 2:04
professionalEddy Vluggen6-Mar-18 2:04 
AnswerRe: how can i set windows form over other programs at the desktop in c# Pin
Gerry Schmitz6-Mar-18 6:07
mveGerry Schmitz6-Mar-18 6:07 
AnswerRe: how can i set windows form over other programs at the desktop in c# Pin
Dave Kreskowiak8-Mar-18 4:16
mveDave Kreskowiak8-Mar-18 4:16 
Questionapple push notification Pin
Member 108437285-Mar-18 20:22
Member 108437285-Mar-18 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.