paintpanel.vb

来自「《ViSUAL BASIC》设计模式」· VB 代码 · 共 28 行

VB
28
字号
Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.Drawing.Color
Imports System.WinForms

Public Class PaintPanel 
  Inherits PictureBox

Dim rc as RedCommand
DIm bc as BlueCommand  

public sub setCommands(rdc as RedCommand, blc as BlueCommand)
  rc = rdc
  bc = blc
End Sub


Protected Overrides Sub OnPaint(e as PaintEventArgs) 
         Dim g as Graphics = e.Graphics
        
         rc.draw(g)
         bc.draw(g)   
        
     End Sub
     
End Class  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?