473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Creating a Custom Message Box in C#

I am trying to create a custom MessageBox (which for now I've "cleverly" named MyMessageBox). I have downloaded a new toolkit containing new namespaces which allow me to easily create a "preloaded" custom form... so rather than using System.Windows.Forms; I create a reference to the other reference. So far I've created the new class and have defined the Show method for MyMessageBox. I simply created the class and inherited the other tool kit's form as such...

Expand|Select|Wrap|Line Numbers
  1. using TheNewToolkitNameSpace;
  2.  
  3.       public partial class MyMessageBox : TheNewToolkitNameSpaceForm
  4.     {
  5.         public MyMessageBox()
  6.         {
  7.             InitializeComponent();
  8.         }
  9.         public void Show(string message, string title)
  10.         {
  11.             this.message = "Trying to figure out the
  12.                             easiest way to display the
  13.                             text in the form without
  14.                             using a label control."
  15.             this.Text = title;
  16.             this.Show();
  17.         }
  18.         public void Show(string message, string title, MessageBoxButtons buttons)
  19.         {
  20.             //Haven't thought about the buttons just yet;
  21.             //Though about just using this.Control.Add
  22.             //and setting the values. Perhaps create a
  23.             //sub method to handle that and call it when
  24.             //needed.
  25.             this.Show();
  26.         }
  27.  
"this.message" is what I'm trying to figure out... How to display the text in my custom form as the standard message box does.

Go easy on me... I've not been coding but for a couple months.

Any suggestions?

Thanks
Sep 5 '10 #1
1 2580
Christian Binder
218 Expert 100+
I think you should put a Label on your Form, maybe with Dock = DockStyle.Filled and set the Labels's Text property to your message.
Sep 6 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: NutJob | last post by:
Hello, I'm faced with the following problem: I have a (secondary) thread that monitors a socket for incoming message traffic using the select.select() function. Besides that I also have the...
0
by: Jai | last post by:
Dear All Creating Custom Controls but Not User Controls,How to create custom controls,i.e Extending the functionality of the Existing Controls.(Web Custom Controls). Previously i have...
7
by: WindAndWaves | last post by:
Hi Gurus I am trying to make a custom message box with a dialog form. Here is how I would like to do it: 1- anywhere in the database, in any procedure, I call the function that opens a dialog...
4
by: Alvo von Cossel I | last post by:
hi, i have been asked to make a good-looking app for a friend. i have an options form with a big tabstrip in it. 1. how can i customize it e.g. change from the standard system style...
3
by: Nak | last post by:
Hi there, I am attempting to make a custom message loop in VB.NET so that I can use it for interprocess communication. At current I am successfully creating a window class that never actually...
5
by: frankleggett | last post by:
Hi I want to create a Custom Message box where the label and buttons have variable text in them. I need to run a subroutine that calls the message box and if the answer is yes does 1 thing and...
3
by: =?Utf-8?B?Vk1J?= | last post by:
How can I catch an error and throw the exception message plus some custom text? For example, I'd like to do something like this: try { //generate error } catch { //throw ex + " my custom...
18
by: louie310 | last post by:
I am working on a Access data base as a school project. The data base has forms with fields that need to be filled out. The forms currently are set up where certain fields that are required have...
3
by: louie310 | last post by:
I finally came up with an answer for creating a custom message if the input mask is violated. In the properties window for the phone field, open the data tab. In the validation rule I typed in the...
1
by: Abdo Haji-Ali | last post by:
Previously I used to create user controls if I wanted to use a specific set of controls in multiple pages, however I want to deploy my control in other applications so I thought of creating custom...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.