본문 바로가기
반응형

vb .net 강좌11

visual basic.비주얼베이직,vb .net 강좌-랜덤좌표 이미지,random ,radomize,Location 랜덤하게 이미지를 화면에 위치시키는 프로그램입니다. PictureBox,Timer ,label 2개의 콘트롤을 화면에 위치시킵니다.. Timer 속성 세팅 입니다. 위 의 그림처럼 이미지를 임포트 합니다. Public Class Form1 Dim _x As Integer Dim _y As Integer Dim rnd As New Random Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick _x = rnd.Next(0, Me.Width) 'Me.Width 폼의 x 크기 _y = rnd.Next(0, Me.Height) Label1.Text = _x & "." & _y PictureBox1.Location = New .. 2017. 2. 3.
visual basic,비주얼베이직,vb .net 강좌-ms sql 접속테스트,SqlConnection ,SqlCommand,conntect Text, 'Form1.vb Public Class Form1 Dim SQL As New SQLControl Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load If SQL.HasConection = True Then MessageBox.Show("seccesfully connected") End If End SubEnd Class 'SQLControl.vb Imports System.Data.SqlImports System.Data.SqlClient Public Class SQLControl Public SQLCon As New SqlConnection With {.ConnectionString = "Server=MSDN-SPE.. 2017. 2. 2.
visual basic,비주얼베이직,vb .net 강좌-프로그래스바 기초,ProgressBar basic,lording bar ,Timer button 2개 timer 1개 label 2개 ProgressBar 1개를 위와 같이 배치합니다., timer 설정은 위와 같이 합니다. Public Class Form1 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Label1.Text += 1 ' Timer 틱마다 숫자 1씩 증가 ProgressBar1.Value = Label1.Text ' Label1.Text ProgressBar값으로 입력 If ProgressBar1.Value = 100 Then Timer1.Stop() End If End Sub Private Sub Button1_Click(sender As Object, e As EventArg.. 2017. 1. 31.
visual basic,비주얼베이직,vb .net 강좌-size mode,Timer,PictureBox 자동으로 이동하는 이미지 타이머를 이용하여 자동적으로 좌측으로 움직이다가 버튼 클릭시 스톱 또는 재시작하는 프로그램입니다..타이머 와 버튼2개 픽쳐박스를 세팅합니다. 픽쳐박스 상단 역삼각형을 클릭해서 이미지를 임포트 하고 size mode 도 위와 같이 셋팅합니다. 타이머의 속성을 위와같이 해줍니다. Public Class Form1 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick If PictureBox1.Left 2017. 1. 27.
반응형