Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:38:28+00:00 2026-06-01T12:38:28+00:00

I try to get the following done: A WPF application where i have multiple

  • 0

I try to get the following done:

A WPF application where i have multiple buttons where you can set a notification message.
Depending on the button, you can set different messages.

What i did, was on the message button i have put this code:

private void button1_Click(object sender, RoutedEventArgs e)
 {
    CounterMessage msgOne = new CounterMessage();
    msgOne.ShowDialog();
 }

This will open op a new WPF window here only is a textbox and an exit button.
On exit in this message window, it will save the message to a parameter.

But here is the trick.
I want to use this message window for multiple notifications, and it will display in the textbox any text content if there is already any on a string in the application.

So for example:
In the main app i have button A and B to set the notification on.
I click on button A, the showdialog pops up and in the textbox already have “you clicked button A”
If it was button B that has been clicked, it should display “you clicked button B”

So i should sent some extra info with the ShowDialog, so i can use the messagewindow for each one.
Could someone help me out a bit herE?

I must say i find it a bit hard do decently discribe what i want, so i hope i made myself clear enough.

EDIT
So hat i want is showing the content of a string parameter (to be exact: Properties.Settings.Default.XXX) into the textbox that is in the Countermessage window

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:38:30+00:00Added an answer on June 1, 2026 at 12:38 pm

    I am not entirely sure what you are asking, but it sounds like you want something like this. I am assuming that CounterMessage is a Window, and that there is some binding mechanism or property that displays what the message is.

    public class CounterMessage : Window
    {
        public CounterMessage(string message)
        {
            this.Message = message;
        }
    
        public string Message
        {
            get;
            set;
        }
    }
    

    Your button event would then be something along the lines of:

    private void button1_Click(object sender, RoutedEventArgs e)
    {
         Button btn = sender as Button;
         CounterMessage msgOne = new CounterMessage(btn.Text);
         msgOne.ShowDialog();      
    }
    

    The point being that you don’t send something to the ShowDialog method, but rather to the class that is the dialog itself. I also assume that the dialog does more than just displaying the message – otherwise, you would just use MessageBox.Show(....)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get the following done: I have a set of fonts and
I a WPF application I have the following event-handler of a button-click in a
I get the following error message when I try the following: Dim XL As
I have done the following to get record for user info from address book.
I try to get this following url using the downloadURL function as follows: http://www.ncbi.nlm.nih.gov/nuccore/27884304
When I try to I get the following error in SQL Server Management Studio:
Sometimes when i try to build/compile a downloaded source, i get following warning: ld:
I get the following error when I try and execute the code down below.
I get the following error when I try to run sample example of Google
I get the following error in the UDK Frontend when I try to make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.