Re: Enumerations And Random Numbers
From: Larry Serflaten (serflaten_at_usinternet.com)
Date: 10/30/04
- Next message: Michael Maes: "Update of a Master-Detail Hierarchy of Three levels"
- Previous message: Mark: "Locate/parse text"
- In reply to: Herfried K. Wagner [MVP]: "Re: Enumerations And Random Numbers"
- Next in thread: Herfried K. Wagner [MVP]: "Re: Enumerations And Random Numbers"
- Reply: Herfried K. Wagner [MVP]: "Re: Enumerations And Random Numbers"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 30 Oct 2004 07:21:01 -0500
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote
> Dim Values() As AnchorStyles = [Enum].GetValues(GetType(AnchorStyles))
> Dim r As New Random
> MsgBox(Values(r.Next(0, Values.Length - 1)).ToString())
The maxValue of Next needs to be one greater than the last value desired:
Dim Values() As AnchorStyles = CType([Enum].GetValues(GetType(AnchorStyles)), AnchorStyles())
Dim r As New Random
MsgBox(Values(r.Next(0, Values.Length)).ToString())
LFS
- Next message: Michael Maes: "Update of a Master-Detail Hierarchy of Three levels"
- Previous message: Mark: "Locate/parse text"
- In reply to: Herfried K. Wagner [MVP]: "Re: Enumerations And Random Numbers"
- Next in thread: Herfried K. Wagner [MVP]: "Re: Enumerations And Random Numbers"
- Reply: Herfried K. Wagner [MVP]: "Re: Enumerations And Random Numbers"
- Messages sorted by: [ date ] [ thread ]