Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XS✔ ◾ Rename rule and update uri #7484

Merged
merged 3 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ index:
- title-bar-do-you-put-your-company-url-in-the-title-bar
- menu-do-you-use-icons-in-menu
- sound-do-you-realize-the-importance-of-sounds-to-user-interface
- sound-did-you-know-that-a-message-box-automatically-plays-a-beep
- sound-message-box
- long-process-do-you-know-how-to-make-long-running-processes-user-friendly
- long-process-do-you-show-the-status-of-progress-bar-on-winforms-title
- long-process-do-you-know-that-long-running-processes-should-allow-to-skip-the-processing-when-appropriate
Expand All @@ -30,4 +30,3 @@ index:
Since 1990, SSW has supported the developer community by publishing all our best practices and rules for everyone to see.

If you still need help, visit [Website Design and User Experience](http://www.ssw.com.au/ssw/Consulting/WebsiteDesignAndUserExperience.aspx) and book in a consultant.

Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
type: rule
title: Sound - Did you know that a message box automatically plays a beep?
uri: sound-did-you-know-that-a-message-box-automatically-plays-a-beep
uri: sound-message-box
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan
related: []
redirects: []
redirects:
- sound-did-you-know-that-a-message-box-automatically-plays-a-beep
created: 2012-11-27T02:57:30.000Z
archivedreason: null
guid: 81d5da16-4a3d-420e-b92c-f73a0791b290
Expand All @@ -20,23 +21,25 @@ A message box automatically provides this functionality so there is no need to m
![Figure: Good example - Windows message boxes plays a sound... which cannot be captured in screenshot form.](../../assets/Win7SoundError.png)
:::

```vbnet
Dim Message As String = "You did not enter a server name. Cancel this operation?"
Dim Caption As String = "No Server Name Specified"
Dim Buttons As Integer = MessageBoxButtons.YesNo
Beep()
result = MessageBox.Show( Me, Message, Caption, Buttons)
```csharp
string message = "You did not enter a server name. Cancel this operation?";
string caption = "No Server Name Specified";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
System.Media.SystemSounds.Beep.Play();
DialogResult result = MessageBox.Show(this, message, caption, buttons);
```

::: bad
Figure: Bad example - The sound on the button is hardcoded in this code snippet
:::

```vbnet
Dim Message As String = "You did not enter a server name. Cancel this operation?"
Dim Caption As String = "No Server Name Specified"
Dim Buttons As Integer = MessageBoxButtons.YesNo
result = MessageBox.Show( Me, Message, Caption, Buttons)
```csharp
string message = "You did not enter a server name. Cancel this operation?";
string caption = "No Server Name Specified";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show(this, message, caption, buttons);
```

::: good
Figure: Good example - The code is not present in this example as it is automatically done
:::