473,729 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to inherite a class from System.windows. form.MessageBox ?


Hi,
I want to add more buttons to messagebox, such as "Apply All".
Can i implement a custom messagebox, inherite from System.Windows. Form.MessageBox ?

Best wish,

harvie

2006-1-18
Jan 18 '06 #1
4 7346
> Can i implement a custom messagebox, inherite from System.Windows. Form.MessageBox ?

No you'll have to inherit from Form and build it from scratch. The
standard MessageBox is provided by the operating system and not
extensible.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 18 '06 #2
Hello Mattias,

thanks!
Can i implement a custom messagebox, inherite from
System.Windows. Form.MessageBox ?

No you'll have to inherit from Form and build it from scratch. The
standard MessageBox is provided by the operating system and not
extensible.

Mattias

Jan 18 '06 #3
> No you'll have to inherit from Form and build it from scratch. The
standard MessageBox is provided by the operating system and not
extensible. Mattias


Actually, that is kinda incorrect. You can extend the MessageBox class,
but it requires a lot PInvoke class and a lot of pain for it to be
worthwhile. Below is an article on MSDN that talks about it:

http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Jan 18 '06 #4
>Actually, that is kinda incorrect. You can extend the MessageBox class,

OK if you want to play the nitpicking game you're incorrect too. You
can't extend the MessageBox _class_ since it only has a private
constructor (and should really have been a static class if they had
existed in v1).

Sure you can do all sorts of weird things with the message box dialog
window with Win32 APIs, but just because you can doesn't mean you
should.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2006
by: Mike | last post by:
Please help this is driving me nuts. I have 2 forms, 1 user class and I am trying to implement a singleton class. Form 1 should create a user object and populate some properties in user. Form2 should then have access to those user properties. I am not getting the property value from user that was set in form1. Sorry for posting so much code but I need help bad. How do i make this work? Thanks Mike
3
3053
by: glenn | last post by:
I am assuming that Microsoft has renamed their (dll's) and are now calling them class libraries since I can't find anything related to dll's in Visual Studio. If I am correct in this assumption then can anyone help me with how to have my class library display a MessageBox.Show. I can't seem to add the proper using statement to get access to that class. Can dll's access messageboxes? On a side note: Is is possible for a class...
0
1910
by: Deepak C.G via .NET 247 | last post by:
I want to dispose the image object in my child form, unless I won't dispose this object i can't delete the image file in my folder. I get this error in MDIparent form "An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll" "Additional information: Invalid parameter used." Here is my code:-
5
1945
by: RSH | last post by:
I havent been able to set a property from another class with out getting some sort of error. Can someone please tell me what I'm doing wrong here? Public Class Form1
2
1839
by: Ryan Liu | last post by:
Hi, Can someone give me a hlep on inherited user control? I try to inherite windows forms user control, like ListView. From Visual studio 2003, I right click a folder and selct "Add inherited user control ...", then I browser to c:\winnt\microsoft.net\framework\v1.1.4322\system.windows.forms.dll
2
2177
by: GoCoogs | last post by:
I'm trying to count how many items are in a dynamic collection. This is the code I have so far. *** Begin Code *** Public Class Rule Private _rulevars As RuleVarsCollection Private _rulename As String Public Property Name() As String Get
3
1411
by: garyusenet | last post by:
Hello everyone I hope you are having a good evening. This evening I made a method that allows me to find the process id's of running processes of a given 'friendly name' - using System.Diagnostic.Process. Here is my code that works fine: - using System; using System.Collections.Generic;
0
1145
by: xamman | last post by:
hi there! according to msdn (link at bottom) i should be able to protect a whole class declaratively as above. However i keep getting 'request for principal permissions failed' exceptions. in the msdn article a reference is made to include AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) in your code to set the appdomain principal.I can understand how to use setprincipalpolicy to protect a method declaratively...
0
899
by: xamman | last post by:
hello! anyone ever manage to do this? after trying nearly everything i can think of my code (below) still gives 'request for principal permissions failed' . many thanks
0
8924
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8763
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9153
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6026
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4797
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3240
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2689
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2165
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.