新建窗口,添加picture控件
創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供梁子湖網(wǎng)站建設(shè)、梁子湖做網(wǎng)站、梁子湖網(wǎng)站設(shè)計、梁子湖網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、梁子湖企業(yè)網(wǎng)站模板建站服務(wù),十載梁子湖做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。
利用line()方法畫線
line(開始x坐標(biāo),開始y坐標(biāo))-(結(jié)束x坐標(biāo),結(jié)束y坐標(biāo)),線的顏色,畫線的方式(默認(rèn)為線,B為矩形無填充,BF為填充的矩形)
For i = 1 To 16
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(255, 0, 0)
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(255, 0, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(0, 255, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(0, 255, 0)
Next i
如果要在窗口上畫也可以調(diào)用窗口的line方法即form.line()
Private Sub 開機(jī)自動啟動_Click(sender As Object, e As EventArgs) Handles 開機(jī)自動啟動.Click
Dim a As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Run")
a.SetValue("查看.exe", Application.StartupPath "\查看.exe")
End Sub
Private Sub 關(guān)閉開機(jī)自啟_Click(sender As Object, e As EventArgs) Handles 關(guān)閉開機(jī)自啟.Click
Dim a As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Run")
a.DeleteValue("查看.exe")
End Sub
using?System;
using?System.Windows.Forms;
namespace?WindowsFormsApplication1
{
public?partial?class?Form1?:?Form
{
Timer?tm?=?new?Timer();//實(shí)例化?timeer?
static?int?timeS?=?0;?//設(shè)置靜態(tài)變量記錄秒數(shù)
TimeSpan?ts?=?new?TimeSpan();?//實(shí)例化?TimeSpan?
public?Form1()
{
InitializeComponent();
}
private?void?button1_Click(object?sender,?EventArgs?e)
{
tm.Interval?=?1000;?//設(shè)置?timeer?1000毫秒執(zhí)行一次
tm.Tick?+=?new?EventHandler(timeer_Tick);?//設(shè)置?timeer?運(yùn)行事件
tm.Start();?//?啟用?timeer
}
private?void?timeer_Tick(object?sender,?EventArgs?e)
{
timeS?+=?1;?//秒數(shù)?+1?
ts?=?new?TimeSpan(0,?0,?timeS);?
label1.Text?=?ts.Hours?+?":"?+?ts.Minutes?+?":"?+?ts.Seconds;
}
private?void?button2_Click(object?sender,?EventArgs?e)
{
tm.Stop();
timeS?=?0;
}
}
}