Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to set picturebox width with form width in c#

private void Form1_Resize(object sender, System.EventArgs e)
{
   Control control = (Control)sender;


   double percentage = 0.7;    
   int width = control.Size.Width;
   //width = (int)Math.Round(test*perc); imagewidth 70% of form width
   int heigth = control.Size.Width;

   picturebox1.Size = new Size(width,height);  

}
Comment

PREVIOUS NEXT
Code Example
Csharp :: adding values to mock IHttpContextAccessor unit test .net core 
Csharp :: c# delegate 
Csharp :: dictionary in c# unity 
Csharp :: unity find gameobject with layer 
Csharp :: hcf of numbers 
Csharp :: how to disable vsync in monogame 
Csharp :: C# Http.HttpRequestMessage 
Csharp :: top level statements c# 
Csharp :: nunjucks index in loop 
Csharp :: how to restart flutter app programmatically 
Csharp :: unity 2d 
Csharp :: multiplication using arrays 
Csharp :: c# copy files from one folder to another 
Csharp :: c# windows forms open directory in explorer 
Csharp :: contains duplicate 
Csharp :: c# get list item in random order 
Csharp :: how get data from json in c# 
Csharp :: c# string list 
Csharp :: c# streamwriter add new line 
Csharp :: c# numbers only 
Csharp :: how to compare datetime in c# 
Csharp :: bsod screen c# 
Csharp :: how to type to console in unity 
Csharp :: wpf textblock line break code behind 
Csharp :: c# get all classes derived from type 
Csharp :: c# system.text.json deserialize 
Csharp :: encrypt with public key and decrypt with private key c# 
Csharp :: Metadata publishing for this service is currently disabled 
Csharp :: what is list in c# 
Csharp :: unity agent look at 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =