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

  • SEARCH
  • Home
  • 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 7176597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:32:34+00:00 2026-05-28T16:32:34+00:00

Why? I built a simple custom MessageBox as as a Dialog in C#. When

  • 0

Why?

I built a simple custom MessageBox as as a Dialog in C#. When I show the message boxvia Show(), the message text is not highlighted. When I show this messagebox vi ShowDialog(), the text is highlighted.

I don’t want my text to be highlighted. Any thoughts or ideas?

public partial class MyMessageBox : Form
    {
        private String mCaption;
        private String mMessage;


        public MyMessageBox( Form anOwner, String aCaption, String aMessage )
        {
            InitializeComponent();

            mCaption = aCaption;
            Owner = anOwner;
            mMessage = aMessage;
        }


        private void btnCancelRequest_Click( object sender, EventArgs e )
        {
            ( (AddressForm)Owner ).RequestCancelled();
        }


        private void btnOk_Click( object sender, EventArgs e )
        {
            CloseDialog();
        }


        public void CloseDialog()
        {
            Close();
        }


        // Called from the Address Form
        public void HideCancelRequestButton()
        {
            btnCancelRequest.Visible = false;
        }


        private void MyMessageBox_Activated( object sender, EventArgs e )
        {
            Text = mCaption;
            txtMessage.Text = mMessage;
        }
    }
  • 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-05-28T16:32:35+00:00Added an answer on May 28, 2026 at 4:32 pm

    While I don’t see why the text would be highlighted, you could avoid this by explicitly specifying the textbox selection length:

    txtMessage.SelectionLength = 0;
    

    though as Jeremy commented, this may be a better use of a label unless you’re actually expecting user input.

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

Sidebar

Related Questions

I've built a simple cms with an admin section. I want to create something
I'm working with an already built ASP.Net custom date control, it seems pretty simple,
I have a question this time around regarding the Android custom camera, NOT the
I'm working on a simple custom cms - this is for a school that
I want to add a custom right-click menu to my web application. Can this
I've built a simple .NET 4 custom downloader console app and am finding that
I've built a custom page.php template. Very simple, essentially: <?php get_header(); ?> <?php get_sidebar();
I am trying to create a resize toggle animation on this simple custom TUIScrollView
I built a very simple custom Comparator, that I use with a TreeSet in
i built a service with a custom operation selector, the selector simply looks at

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.