Debug the application by pressing F5 to execute the Windows Forms application. After debugging the application the output will be as in the following figure:
Step 12:
Write the following code to move the mouse in a FillArc shape in the F# editor.
open System
open System.Windows.Forms
open System.Drawing
let drawfillpieform = new Form(Text="Draw FilPie MouseMouse")
drawfillpieform.BackColor<-Color.Gray
let exitbutton=new Button(Top=200,Left=200)
exitbutton.Text<-"Exit"
exitbutton.BackColor<-Color.Ivory
let crgraphics=drawfillpieform.CreateGraphics()
drawfillpieform.Controls.Add(exitbutton)
drawfillpieform.MouseMove.Add(fun move->crgraphics.FillPie(Brushes.MidnightBlue,new Rectangle(move.X,move.Y,15,15),170.0f,170.0f))
exitbutton.Click.Add(fun close->drawfillpieform.Close())
Application.Run(drawfillpieform)
Step 13:
Debug the application by pressing F5 to execute the Windows Forms application. After debugging the application the output will be as in the following figure:
Step 14:
Write the following code to move the mouse in an FillEllipse shape in the F# editor.
open System
open System.Windows.Forms
open System.Drawing
let fillellipseform = new Form(Text="Draw FillEllipse MouseMove")
fillellipseform.BackColor<-Color.Gray
let exitbutton=new Button(Top=200,Left=200)
exitbutton.Text<-"Exit"
exitbutton.BackColor<-Color.Ivory
let crgraphics=fillellipseform.CreateGraphics()
fillellipseform.Controls.Add(exitbutton)
fillellipseform.MouseMove.Add(fun move->crgraphics.FillEllipse(Brushes.Red,new Rectangle(move.X,move.Y,15,15)))
exitbutton.Click.Add(fun close->fillellipseform.Close())
Application.Run(fillellipseform)
Step 15:
Debug the application by pressing F5 to execute the Windows Forms application. After debugging the application the output will be as in the following figure:
Step 16:
Write the following code to move the mouse in a FillRectangle shape in the F# editor.
open System
open System.Windows.Forms
open System.Drawing
let fillrecform = new Form(Text="Draw FillRectangle MouseMove")
fillrecform.BackColor<-Color.Gray
let exitbutton=new Button(Top=200,Left=200)
exitbutton.Text<-"Exit"
exitbutton.BackColor<-Color.Ivory
let crgraphics=fillrecform.CreateGraphics()
fillrecform.Controls.Add(exitbutton)
fillrecform.MouseMove.Add(fun move->crgraphics.FillRectangle(Brushes.Indigo,new Rectangle(move.X,move.Y,15,15)))
exitbutton.Click.Add(fun close->fillrecform.Close())
Application.Run(fillrecform)
Step 17:
Debug the application by pressing F5 to execute the Windows Forms application. After debugging the application the output will be as in the following figure: