Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get index Brushes properties C#

private Brush PickBrush()
{
    Brush result = Brushes.Transparent;

    Random rnd = new Random();

    Type brushesType = typeof(Brushes);

    PropertyInfo[] properties = brushesType.GetProperties();

    int random = rnd.Next(properties.Length);
    result = (Brush)properties[random].GetValue(null, null);

    return result;
}
Comment

get index Brushes properties C#

Random rnd = new Random();
Brush brush = brushes[rnd.Next(brushes.Length)];
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity werfen mit höhe 
Csharp :: c# standard microphone decibels 
Csharp :: context.Response.Body read stream .net 
Csharp :: how to update model in entity framework db first approach 
Csharp :: listview inter thread operation not valid 
Csharp :: c# find comma in text and remove 
Csharp :: go right unity 
Csharp :: how to write text in specific position in c# 
Csharp :: cross thread exception in c# control 
Csharp :: wpf textbox insert text at caret position 
Csharp :: c# retry delay request 
Csharp :: translate int to string with x 0 before c# 
Csharp :: C# top down view movement 
Csharp :: get all properties of an object including children c# 
Csharp :: extension method in c# 
Csharp :: multi case in c# 
Csharp :: if input.get touch 
Csharp :: encrypt password easiest way in web app .net 
Csharp :: unity2d switch camera 
Csharp :: wpf StrokeDashArray 
Csharp :: load information with txt file to uwp c# 
Csharp :: c# system cryptography hash string 
Csharp :: c# clear panel 
Csharp :: play sound in sequence unity 
Csharp :: c# while loops 
Csharp :: count number of specific characters in string c# 
Csharp :: is narcissistic number 
Csharp :: c# how to check the minimum and maximum of numbers 
Csharp :: restrictions 
Csharp :: string.format() c# 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =