Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# random color

Random r = new Random();
BackColor = Color.FromArgb(r.Next(0, 256), r.Next(0, 256), 0);
Comment

c# random color


public partial class Form1 : Form
{
    private Random rnd = new Random();

    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {  
        Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));

        BackColor = randomColor;
    }
}

Comment

PREVIOUS NEXT
Code Example
Csharp :: unity editor select object in script 
Csharp :: unity 3d camera rotate up and down 
Csharp :: left moust click unity 
Csharp :: wann war der dritte weltkrieg 
Csharp :: c# check if string is empty 
Csharp :: randomize through array in C# 
Csharp :: dotnet executable directory 
Csharp :: writeline c# 
Csharp :: wpf close application 
Csharp :: core Request.CreateResponse 
Csharp :: how to delay execution in c# 
Csharp :: c# string to double 
Csharp :: asp core asp for not working 
Csharp :: button color uwp c# 
Csharp :: get path c# 
Csharp :: unity disable cursor 
Csharp :: c# main method 
Csharp :: c# list all files in a directory and subdirectory 
Csharp :: c# get next item in list 
Csharp :: how to draw text in monogame 
Csharp :: taking input in single line c# 
Csharp :: how to choose a random child in a gameobject unuity 
Csharp :: xml node update attribute value c# 
Csharp :: {} is this used for code blcoks in c# 
Csharp :: how to make a game 
Csharp :: add tablelayoutpanel dynamicly to winform in c# 
Csharp :: restart animation unity 
Csharp :: net.core "a path base can only be configured using iapplicationbuilder.usepathbase()" 
Csharp :: c# image to byte array 
Csharp :: c# loop 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =