首次使用请先拉取GoVCL的代码。
获取GoVCL代码
go get -u github.com/ying32/govcl
编写代码
- 1、通过res2go IDE插件生成GUI
此种方法是通过res2go IDE插件生成GUI。
package main
import (
"github.com/ying32/govcl/vcl"
// 如果你使用自定义的syso文件则不要引用此包
_ "github.com/ying32/govcl/pkgs/winappres"
)
type TMainForm struct {
*vcl.TForm
Btn1 *vcl.TButton
}
type TAboutForm struct {
*vcl.TForm
Btn1 *vcl.TButton
}
var (
mainForm *TMainForm
aboutForm *TAboutForm
)
func main() {
vcl.Application.Initialize()
vcl.Application.SetMainFormOnTaskBar(true)
vcl.Application.CreateForm(&mainForm)
vcl.Application.CreateForm(&aboutForm)
vcl.Application.Run<