Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
GeneralRe: Create a file and set the extended properties like companyname, comment, etc. Pin
Heath Stewart3-Feb-04 6:00
protectorHeath Stewart3-Feb-04 6:00 
Generalmessage boxes Pin
ASGill3-Feb-04 1:29
ASGill3-Feb-04 1:29 
GeneralRe: message boxes Pin
sps-itsec463-Feb-04 2:09
sps-itsec463-Feb-04 2:09 
GeneralRe: message boxes Pin
thomasa3-Feb-04 2:22
thomasa3-Feb-04 2:22 
GeneralRe: message boxes Pin
dxhdxh3-Feb-04 3:10
dxhdxh3-Feb-04 3:10 
GeneralRe: message boxes Pin
Heath Stewart3-Feb-04 6:17
protectorHeath Stewart3-Feb-04 6:17 
GeneralRe: message boxes Pin
ASGill3-Feb-04 16:58
ASGill3-Feb-04 16:58 
GeneralRe: message boxes Pin
Heath Stewart3-Feb-04 18:04
protectorHeath Stewart3-Feb-04 18:04 
This isn't a difficult problem if you'd only read the .NET Framework SDK documentation. Type MessageBox.Show in the help index and you'll see all the overloads. Most of your method calls are all wrong. The majority of your errors are because you're using the wrong parameters in the wrong order for MessageBox.Show - this is all documented in the .NET Framework SDK. "Error" 1 isn't even an error - it's a warning. If you're not going to use the exception information, then you don't need to declare an Exception variable. You can do either of the following:
try
{
}
catch (Exception)
{
}
// OR
try
{
}
catch
{
}
You must read the documentation. Fumbling around blind won't help. Even looking at the documentation displayed in IntelliSense (the drop-down menu that appears when you're coding statements) would tell you what parameters should go where.

Also, in one line you're trying to use the > operator with a string! This doesn't work. If you want to check the length, use txtPassword.Text.Length > 10.

In many of your incorrectly called MessageBox.Show calls, you call it using specific buttons but you never compare the return with a DialogResult! What's the point? If all you're doing is displaying an error to a user, you shouldn't even define which buttons to display because "OK" is the default button. If you actually get the return value and compare it against a DialogResult enumeration, that's a different subject:
DialogResult result = MessageBox.Show("Would you like to retry?", "Prompt",
  MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
  // Retry code.
}


 

Microsoft MVP, Visual C#
My Articles
GeneralPrintPreviewDialog Pin
Anonymous3-Feb-04 1:16
Anonymous3-Feb-04 1:16 
GeneralRe: PrintPreviewDialog Pin
Heath Stewart3-Feb-04 4:18
protectorHeath Stewart3-Feb-04 4:18 
GeneralRe: PrintPreviewDialog Pin
Anonymous4-Feb-04 1:05
Anonymous4-Feb-04 1:05 
GeneralRe: PrintPreviewDialog Pin
Heath Stewart4-Feb-04 3:42
protectorHeath Stewart4-Feb-04 3:42 
GeneralRe: PrintPreviewDialog Pin
Anonymous4-Feb-04 4:07
Anonymous4-Feb-04 4:07 
GeneralSerialization of object references Pin
sps-itsec463-Feb-04 0:43
sps-itsec463-Feb-04 0:43 
GeneralRe: Serialization of object references Pin
Heath Stewart3-Feb-04 4:25
protectorHeath Stewart3-Feb-04 4:25 
GeneralRe: Serialization of object references Pin
sps-itsec463-Feb-04 6:18
sps-itsec463-Feb-04 6:18 
GeneralRe: Serialization of object references Pin
Heath Stewart3-Feb-04 6:38
protectorHeath Stewart3-Feb-04 6:38 
GeneralDecimal Places Pin
Reinier van de Wetering2-Feb-04 19:41
Reinier van de Wetering2-Feb-04 19:41 
GeneralRe: Decimal Places Pin
Rampas Tomas2-Feb-04 22:32
Rampas Tomas2-Feb-04 22:32 
GeneralRe: Decimal Places Pin
Heath Stewart3-Feb-04 4:36
protectorHeath Stewart3-Feb-04 4:36 
GeneralDatagrid row Color Pin
Reinier van de Wetering2-Feb-04 19:19
Reinier van de Wetering2-Feb-04 19:19 
GeneralRe: Datagrid row Color Pin
Mazdak2-Feb-04 22:09
Mazdak2-Feb-04 22:09 
GeneralRe: Datagrid row Color Pin
Reinier van de Wetering3-Feb-04 19:19
Reinier van de Wetering3-Feb-04 19:19 
GeneralRe: Datagrid row Color Pin
Reinier van de Wetering3-Feb-04 19:49
Reinier van de Wetering3-Feb-04 19:49 
GeneralUpdating DataBase Pin
GetOn&GetGoing2-Feb-04 18:40
GetOn&GetGoing2-Feb-04 18:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.