473,394 Members | 1,709 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,394 software developers and data experts.

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 7328
> 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
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...
3
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...
0
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...
5
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
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...
2
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...
3
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...
0
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...
0
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.