5 Replies - 16762 Views - Last Post: 15 November 2011 - 05:17 AM

#1 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Challenge: Message Box

Post icon  Posted 13 October 2011 - 12:48 PM

Challenge: Message Box(Easy - Advanced)

Following on from the Pro & Cons of MessageBox Discussion Thread.

You have been tasked to create an alternative.

Requirements.

  • Taking care of some/all of the Cons.
    State which, then we can assess if it is solution.
  • Must be able to be used as a direct replacement of MessageBox. (Ok mostly compatible.)
  • You must state the minimum .net framework it works on.
  • Source code must be provided.
  • A Zipped DLL / or NuGet Package.

This post has been edited by AdamSpeight2008: 15 October 2011 - 09:40 AM


Is This A Good Question/Topic? 2
  • +

Replies To: Challenge: Message Box

#2 smohd  Icon User is offline

  • Critical Section
  • member icon


Reputation: 1820
  • View blog
  • Posts: 4,627
  • Joined: 14-March 10

Re: Challenge: Message Box

Posted 13 October 2011 - 01:00 PM

Nice creativity AdamSpeight2008, it is a nice challenge.

View Post_HAWK_, on 12 October 2011 - 08:55 AM, said:

I see your point Adam! I like the way you think.
:)
Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Re: Challenge: Message Box

Posted 13 October 2011 - 08:28 PM

Asynchronous Wrapper around standard MessageBox.

Spoiler

Was This Post Helpful? 1
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Re: Challenge: Message Box

Posted 14 October 2011 - 01:59 PM

Create a NuGet Package for Async_MessageBox. So you can play around with it.
Was This Post Helpful? 1
  • +
  • -

#5 dawmail333  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 27
  • View blog
  • Posts: 174
  • Joined: 02-July 07

Re: Challenge: Message Box

Posted 16 October 2011 - 07:30 AM

I've been wanting to learn how to use GitHub, so I put this challenge up there. I also did it because I'm undoubtedly going to make changes later, and that way I won't have to keep bugging a moderator.

Requires: .Net 3.5 Client Profile (uses WPF)

Cons I've dealt with (as of the first version):

  • Custom Icons/Buttons
  • Custom Layout Support
  • Asynchronous Messages
  • Restricts its size scaling (native MessageBox can potentially cover the entire screen, my version puts the message in a scrollable textbox to keep things sane)


You also may find interesting:
  • You can use a static method to display your message, or you can create an instance of the message class, and set the properties, and then display it.
  • Because the new static Show method uses optional parameters, you don't have to set all the in-between ones, meaning you could just set the message, and the settings, and none of the in-between parameters.


You can use it much the same way as the old message box, intellisense should let you know what's different. I'll work on better documentation a little later, as it's 12:05PM, and I figured the coding was the most important part. There's a lot to this implementation, and I want to do a fair bit more.

However, I will put a couple of examples here that fit the current syntax:

        ' Run-of-the-mill call
        Message.Show("Hello World!")
        ' Asynchronous call. Also showcases the support for non-standard exits (press 'x', 'esc', alt + f4 etc)
        Message.Show(Sub(o, r)
                         ' Looks like they didn't use a button.
                         If r < 0 Then Message.Show("You didn't use one of the buttons.")
                         ' Uses a few 'MessageBox' style parameters
                         Message.Show("You need to be an administrator to perform this task.", "Administrator Privileges Required", MessageButtons.RetryCancel, MessageIcons.Shield)
                         ' Prevents the user from giving any non-button answer (in case there's no 'safe default' answer, for example)
                         Message.Show("Are you sure you wish to format TOSHIBA?", "Confirmation", MessageButtons.YesNo, MessageIcons.Exclamation, MessageSettings.DisableStandardClose)
                     End Sub, "Asynchronous example", buttons:=MessageButtons.OK)


System.Windows.Dialogs.Message - Repo

Downloads (zipped binaries/source zip)
Was This Post Helpful? 1
  • +
  • -

#6 dawmail333  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 27
  • View blog
  • Posts: 174
  • Joined: 02-July 07

Re: Challenge: Message Box

Posted 15 November 2011 - 05:17 AM

Nice to see the D.I.C. community going all out on this challenge.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1