mirror of
				https://github.com/raylib-cs/raylib-cs
				synced 2025-10-29 05:59:51 -04:00 
			
		
		
		
	- Changed internal class name from rl to Raylib. - Improving documentation and tidying bindings a bit. - Renamed DrawControl to RayForm. - Bindings now a class library for easy reuse.
		
			
				
	
	
		
			52 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Drawing;
 | |
| using System.Runtime.InteropServices;
 | |
| using System.Windows.Forms;
 | |
| using static Raylib.Raylib;
 | |
| 
 | |
| namespace Raylib
 | |
| {
 | |
|     class DrawControl : Form
 | |
|     {
 | |
|         private Panel panel;
 | |
| 
 | |
|         [DllImport("user32.dll")]
 | |
|         private static extern IntPtr SetParent(IntPtr child, IntPtr newParent);
 | |
|         [DllImport("user32.dll")]
 | |
|         private static extern IntPtr ShowWindow(IntPtr handle, int command);
 | |
| 
 | |
|         public static void Run()
 | |
|         {
 | |
|             Application.EnableVisualStyles();
 | |
|             Application.SetCompatibleTextRenderingDefault(false);
 | |
|             Application.Run(new DrawControl());
 | |
|         }
 | |
| 
 | |
|         public DrawControl()
 | |
|         {
 | |
|             panel = new Panel();
 | |
|             panel.Size = new Size(640, 480);
 | |
|             panel.Location = new Point(80, 10);
 | |
|             panel.BackColor = System.Drawing.Color.Red;
 | |
|             Controls.Add(panel);
 | |
|         }
 | |
| 
 | |
|         private void InitializeComponent()
 | |
|         {
 | |
|             this.SuspendLayout();
 | |
|             // 
 | |
|             // DrawControl
 | |
|             // 
 | |
|             this.ClientSize = new System.Drawing.Size(284, 261);
 | |
|             this.Name = "DrawControl";
 | |
|             this.Load += new System.EventHandler(this.DrawControl_Load);
 | |
|             this.ResumeLayout(false);
 | |
| 
 | |
|         }
 | |
| 
 | |
|         private void DrawControl_Load(object sender, EventArgs e)
 | |
|         {
 | |
| 
 | |
|         }
 | |
|     }
 | |
| } |