31.10.11

Moving Bouncing Ball with VB.NET

Hi Everybody,

I would like to explain one of faq within this essay , how we can make a moving ball with VB.NET windows application ? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (moving_ball)


2-) We are designing this windows form in a similar way to the picture below


3-)We are writing this code

Public Class Form1

Private Const MOV_BALL_W As Integer = 80
Private Const MOV_BALL_H As Integer = 80
Private x As Integer
Private y As Integer


Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.Clear(Me.BackColor)
e.Graphics.FillEllipse(Brushes.Red, x, y, MOV_BALL_W, MOV_BALL_H)
e.Graphics.DrawEllipse(Pens.Black, x, y, MOV_BALL_W, MOV_BALL_H)
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim rnd As New Random
x = rnd.Next(Me.Width - 80)
y = rnd.Next(Me.Height - 80)
Me.Invalidate()
End Sub
End Class

4-) Lets run the application



5-) Resize the form size


Have a great day

Yener Turkeli
yenerturkeli@v-basic.net

17.10.11

Adobe Form Viewer with VB.NET

Hi Everybody,
I would like to explain one of faq within this essay , how we can can view PDF Form with VB.NET windows application ? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (pdf)




2-) Select adobe component



3-) We need to see adobe component on toolbox




4-) We are designing this windows form in a similar way to the picture below



5-) We are writing this code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'create a openfile dialog
Dim open_file As New OpenFileDialog


'give its filter
open_file.Filter = "PDF files (*.pdf)|*.pdf| Adobe files (*.pdf)|*.pdf"


'if ok click at opendialog
If open_file.ShowDialog() = DialogResult.OK Then

Me.AxAcroPDF1.LoadFile(open_file.FileName)
End If



6-) Lets run the application


Have a great day

Yener Turkeli
yenerturkeli@v-basic.net


2.10.11

Flash Player with VB.NET

Hi Everybody,
I would like to explain one of faq within this essay , how we can can work Flash Player with VB.NET windows application ? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (flash_player)




2-) Select flash component



3-)We need to see flash component on toolbox




4-)We are designing this windows form in a similar way to the picture below



5-) We are writing this code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'create a openfile dialog
Dim open_file As New OpenFileDialog




'give its filter
open_file.Filter = "Flash files (*.swf)|*.swf| Flash files (*.swf)|*.swf"




'if ok click at opendialog
If open_file.ShowDialog() = DialogResult.OK Then

'load flash file
Me.AxShockwaveFlash1.LoadMovie(0, open_file.FileName)
End If

End Sub

6-) Lets run the application









Have a great day

Yener Turkeli
yenerturkeli@v-basic.net