webbrowserda dolu form bilgilerini alma id okuma
_____________________________________
User.Text = W.Document.GetElementById("user").GetAttribute("value")
' üsteki user name id tanımlı formun içeriğini user.text içeriğine doldurur.
'value html de formda doldurulan form bölümlerinde değğiştirilen girilen yer anlamına gelir
22 Haziran 2010 Salı
örnek kod vb.net li
http://rapidshare.com/files/401619896/vb.net2008-El_Kitabi.rar
örnek kod
vb.net kod un exe hali bin\Debug dizini içinde bulunur
--------------
verdiğim programım
kayıt 1 ve 2 dat olarak dizinine kaydeder.
değişikliklerin kaydı için sağ üst köşede çek işaretli ise içerik değişir işaretli değilse kayıt olmaz değişirse
-
örnek kod
vb.net kod un exe hali bin\Debug dizini içinde bulunur
--------------
verdiğim programım
kayıt 1 ve 2 dat olarak dizinine kaydeder.
değişikliklerin kaydı için sağ üst köşede çek işaretli ise içerik değişir işaretli değilse kayıt olmaz değişirse
-
zipli kod dahil vb.net programları örnek kod indirme
1 http://www.codeproject.com/
2 http://www.a1vbcode.com/
3 http://search.codesoso.com/Search?q=vb.net
zipli kod dahil vb.net programları
2 http://www.a1vbcode.com/
3 http://search.codesoso.com/Search?q=vb.net
zipli kod dahil vb.net programları
progress bar örneği
progress bar örneği
progressbar1 rin ismini PB ile değiştirdim daha kolay oldu. özelliklerinden title dan
_________________________
Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
Me.PB.Maximum = Convert.ToInt32(e.MaximumProgress)
Me.PB.Value = Convert.ToInt32(e.CurrentProgress)
End Sub
Private Sub WebBrowser1_Navigating(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
PB.Visible = True
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
PB.Visible = False
End Sub
progressbar1 rin ismini PB ile değiştirdim daha kolay oldu. özelliklerinden title dan
_________________________
Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
Me.PB.Maximum = Convert.ToInt32(e.MaximumProgress)
Me.PB.Value = Convert.ToInt32(e.CurrentProgress)
End Sub
Private Sub WebBrowser1_Navigating(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
PB.Visible = True
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
PB.Visible = False
End Sub
vb.net kod ornek cut copy paste
http://www.brangle.com/wordpress/2009/08/how-to-cutcopypaste-text-into-clipboard-using-vb-net/
ten alındı.
--------------------------------------------------------------------------------
'This code was developed by Gerardo Lopez and was downloaded from www.brangle.com
'Complete source code is available at:
'http://www.brangle.com/wordpress/2009/08/how-to-cutcopypaste-text-into-clipboard-using-vb-net/
Public Class Form1
Private Sub btnCut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCut.Click
'Checks to see if the user selected anything
If txtTextBox.SelectedText <> "" Then
'Good, the user selected something
'Copy the information to the clipbaord
Clipboard.SetText(txtTextBox.SelectedText)
'Since this is a cut command, we want to clear whatever
'text they had selected when they clicked cut
txtTextBox.SelectedText = ""
Else
'If there was no text selected, print out an error message box
MsgBox("No text is selected to cut")
End If
End Sub
Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
'Checks to see if the user selected anything
If txtTextBox.SelectedText <> "" Then
'Copy the information to the clipboard
Clipboard.SetText(txtTextBox.SelectedText)
Else
'If no text was selected, print out an error message box
MsgBox("No text is selected to copy")
End If
End Sub
Private Sub btnPaste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPaste.Click
'Get the data stored in the clipboard
Dim iData As IDataObject = Clipboard.GetDataObject()
'Check to see if the data is in a text format
If iData.GetDataPresent(DataFormats.Text) Then
'If it's text, then paste it into the textbox
txtTextBox.SelectedText = CType(iData.GetData(DataFormats.Text), String)
Else
'If it's not text, print a warning message
MsgBox("Data in the clipboard is not availble for entry into a textbox")
End If
End Sub
End Class--------------------------------------------------------------------------------
*
Clipboard.Clear()
*kopya hafızasını temizle
ten alındı.
--------------------------------------------------------------------------------
'This code was developed by Gerardo Lopez and was downloaded from www.brangle.com
'Complete source code is available at:
'http://www.brangle.com/wordpress/2009/08/how-to-cutcopypaste-text-into-clipboard-using-vb-net/
Public Class Form1
Private Sub btnCut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCut.Click
'Checks to see if the user selected anything
If txtTextBox.SelectedText <> "" Then
'Good, the user selected something
'Copy the information to the clipbaord
Clipboard.SetText(txtTextBox.SelectedText)
'Since this is a cut command, we want to clear whatever
'text they had selected when they clicked cut
txtTextBox.SelectedText = ""
Else
'If there was no text selected, print out an error message box
MsgBox("No text is selected to cut")
End If
End Sub
Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
'Checks to see if the user selected anything
If txtTextBox.SelectedText <> "" Then
'Copy the information to the clipboard
Clipboard.SetText(txtTextBox.SelectedText)
Else
'If no text was selected, print out an error message box
MsgBox("No text is selected to copy")
End If
End Sub
Private Sub btnPaste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPaste.Click
'Get the data stored in the clipboard
Dim iData As IDataObject = Clipboard.GetDataObject()
'Check to see if the data is in a text format
If iData.GetDataPresent(DataFormats.Text) Then
'If it's text, then paste it into the textbox
txtTextBox.SelectedText = CType(iData.GetData(DataFormats.Text), String)
Else
'If it's not text, print a warning message
MsgBox("Data in the clipboard is not availble for entry into a textbox")
End If
End Sub
End Class--------------------------------------------------------------------------------
*
Clipboard.Clear()
*kopya hafızasını temizle
'örnek bir webbrowser yapımı
'örnek bir webbrowser yapımı
'--------------------------------------------------------------------------------
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Kod.Visible = False
WebBrowser1.Navigate("http://www.google.com")
End Sub
Private Sub toolStripTextBox1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles Adres.KeyDown
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If (e.KeyCode = Keys.Enter) Then
Navigate(Adres.Text)
End If
End Sub
Private Sub goButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles goButton.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.Navigate(Adres.Text)
End Sub
Private Sub Navigate(ByVal address As String)
WebBrowser1.ScriptErrorsSuppressed = True
If String.IsNullOrEmpty(address) Then Return
If address.Equals("about:blank") Then Return
If Not address.StartsWith("http://") And _
Not address.StartsWith("https://") Then
address = "http://" & address
End If
Try
WebBrowser1.Navigate(New Uri(address))
Catch ex As System.UriFormatException
Return
End Try
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Adres.Text = WebBrowser1.Url.AbsoluteUri
Me.Text = WebBrowser1.Document.Title + "
Kerkur Hızlı Web"
End Sub
Private Sub webBrowser1_Navigated(ByVal sender As Object, ByVal e As WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Adres.Text = WebBrowser1.Url.ToString()
End Sub
Private Sub Geri_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Geri.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If WebBrowser1.CanGoBack = True Then
WebBrowser1.GoBack()
Else
'MsgBox("Cannot go back any further", MsgBoxStyle.Information)
End If
End Sub
Private Sub ileri_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ileri.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If WebBrowser1.CanGoForward = True Then
WebBrowser1.GoForward()
Else
' MsgBox("Cannot go further forward", MsgBoxStyle.Information)
End If
End Sub
Private Sub Anasayfa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Anasayfa.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.GoHome()
End Sub
Private Sub Yenile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Yenile.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.Refresh()
End Sub
Private Sub SKodgoster_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SKodgoster.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
'Sayfa Kodunu al
Kod.Text = WebBrowser1.DocumentText
Kod.Visible = True
End Sub
Private Sub Kod_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Kod.DoubleClick
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If MsgBox("Koddan çıkmakmı istedin", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Kod.Visible = False
Kod.Visible = False
End If
End Sub
Private Sub Arama_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Arama.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
' arama kodu html de varmı diyor işaretlemiyor
Dim kodu As String
Dim aracan As String
kodu = Kod.Text
aracan = InputBox("Aranacak ifade")
Dim arasonuc As String
arasonuc = kodu.IndexOf(aracan)
If arasonuc = -1 Then
MsgBox("İçinde Yok")
Else
MsgBox("Aranan ifade =" & aracan)
End If
End Sub
End Class
'--------------------------------------------------------------------------------
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Kod.Visible = False
WebBrowser1.Navigate("http://www.google.com")
End Sub
Private Sub toolStripTextBox1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles Adres.KeyDown
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If (e.KeyCode = Keys.Enter) Then
Navigate(Adres.Text)
End If
End Sub
Private Sub goButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles goButton.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.Navigate(Adres.Text)
End Sub
Private Sub Navigate(ByVal address As String)
WebBrowser1.ScriptErrorsSuppressed = True
If String.IsNullOrEmpty(address) Then Return
If address.Equals("about:blank") Then Return
If Not address.StartsWith("http://") And _
Not address.StartsWith("https://") Then
address = "http://" & address
End If
Try
WebBrowser1.Navigate(New Uri(address))
Catch ex As System.UriFormatException
Return
End Try
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Adres.Text = WebBrowser1.Url.AbsoluteUri
Me.Text = WebBrowser1.Document.Title + "
Kerkur Hızlı Web"
End Sub
Private Sub webBrowser1_Navigated(ByVal sender As Object, ByVal e As WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Adres.Text = WebBrowser1.Url.ToString()
End Sub
Private Sub Geri_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Geri.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If WebBrowser1.CanGoBack = True Then
WebBrowser1.GoBack()
Else
'MsgBox("Cannot go back any further", MsgBoxStyle.Information)
End If
End Sub
Private Sub ileri_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ileri.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If WebBrowser1.CanGoForward = True Then
WebBrowser1.GoForward()
Else
' MsgBox("Cannot go further forward", MsgBoxStyle.Information)
End If
End Sub
Private Sub Anasayfa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Anasayfa.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.GoHome()
End Sub
Private Sub Yenile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Yenile.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
WebBrowser1.Refresh()
End Sub
Private Sub SKodgoster_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SKodgoster.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
'Sayfa Kodunu al
Kod.Text = WebBrowser1.DocumentText
Kod.Visible = True
End Sub
Private Sub Kod_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Kod.DoubleClick
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If MsgBox("Koddan çıkmakmı istedin", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Kod.Visible = False
Kod.Visible = False
End If
End Sub
Private Sub Arama_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Arama.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
' arama kodu html de varmı diyor işaretlemiyor
Dim kodu As String
Dim aracan As String
kodu = Kod.Text
aracan = InputBox("Aranacak ifade")
Dim arasonuc As String
arasonuc = kodu.IndexOf(aracan)
If arasonuc = -1 Then
MsgBox("İçinde Yok")
Else
MsgBox("Aranan ifade =" & aracan)
End If
End Sub
End Class
webbrowser da sayfa ismini yukarıda gösterme kodu
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Adres.Text = WebBrowser1.Url.AbsoluteUri
Me.Text = WebBrowser1.Document.Title + "Kerkur Hızlı Web"
End Sub
_________________________________________________________
'WebBrowser1.DocumentCompleted burada yazılan kodlar sayfa tam yüklendiğinde yapılmasını istediğiniz kodlardır
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
Adres.Text = WebBrowser1.Url.AbsoluteUri
Me.Text = WebBrowser1.Document.Title + "Kerkur Hızlı Web"
End Sub
_________________________________________________________
'WebBrowser1.DocumentCompleted burada yazılan kodlar sayfa tam yüklendiğinde yapılmasını istediğiniz kodlardır
WebBrowser1.Navigate bu kodu devamlı yazmak yerine Navigate yazmak webbrowserda
WebBrowser1.Navigate bu kodu devamlı yazmak yerine Navigate yazmak webbrowserda
__________________________________________
Private Sub Navigate(ByVal address As String)
WebBrowser1.ScriptErrorsSuppressed = True
If String.IsNullOrEmpty(address) Then Return
If address.Equals("about:blank") Then Return
If Not address.StartsWith("http://") And _
Not address.StartsWith("https://") Then
address = "http://" & address
End If
Try
WebBrowser1.Navigate(New Uri(address))
Catch ex As System.UriFormatException
Return
End Try
End Sub
__________________________________________
Private Sub Navigate(ByVal address As String)
WebBrowser1.ScriptErrorsSuppressed = True
If String.IsNullOrEmpty(address) Then Return
If address.Equals("about:blank") Then Return
If Not address.StartsWith("http://") And _
Not address.StartsWith("https://") Then
address = "http://" & address
End If
Try
WebBrowser1.Navigate(New Uri(address))
Catch ex As System.UriFormatException
Return
End Try
End Sub
adres çubuğunda enter a basınca o adrese gitmesi
Private Sub toolStripTextBox1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles Adres.KeyDown
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If (e.KeyCode = Keys.Enter) Then
Navigate(Adres.Text)
End If
End Sub
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
If (e.KeyCode = Keys.Enter) Then
Navigate(Adres.Text)
End If
End Sub
web Sayfasının Kodunu Kod.Text 'e al
Kod.Text ilkin gözükmiyecek
kodu göster butonuna basınca gösterecek
form1.load kısmında
Kod.Text .visible = false
olacak
--------------------------
Private Sub SKodgoster_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SKodgoster.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
'Sayfa Kodunu al
Kod.Text = WebBrowser1.DocumentText
Kod.Visible = True
End Sub
kodu göster butonuna basınca gösterecek
form1.load kısmında
Kod.Text .visible = false
olacak
--------------------------
Private Sub SKodgoster_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SKodgoster.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
'Sayfa Kodunu al
Kod.Text = WebBrowser1.DocumentText
Kod.Visible = True
End Sub
arama kodu html de ( webbrowser da web sayfasında ) varmı diyor işaretlemiyor
Private Sub Arama_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Arama.Click
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
' arama kodu html de varmı diyor işaretlemiyor
Dim kodu As String
Dim aracan As String
kodu = Kod.Text
aracan = InputBox("Aranacak ifade")
Dim arasonuc As String
arasonuc = kodu.IndexOf(aracan)
If arasonuc = -1 Then
MsgBox("İçinde Yok")
Else
MsgBox("Aranan ifade =" & aracan)
End If
End Sub
On Error Resume Next
WebBrowser1.ScriptErrorsSuppressed = True
' arama kodu html de varmı diyor işaretlemiyor
Dim kodu As String
Dim aracan As String
kodu = Kod.Text
aracan = InputBox("Aranacak ifade")
Dim arasonuc As String
arasonuc = kodu.IndexOf(aracan)
If arasonuc = -1 Then
MsgBox("İçinde Yok")
Else
MsgBox("Aranan ifade =" & aracan)
End If
End Sub
text te enter tuşuna basma olayı buton yerine onay gibi
text te enter tuşuna basma olayı buton yerine onay gibi
Private Sub TextBox1_KeyDown( ByVal sender As Object, ByVal e As KeyEventArgs) Handles TextBox1.KeyDown
If (e.KeyCode = Keys.Enter) Then
Navigate(toolStripTextBox1.Text)
End If
End Sub
Private Sub TextBox1_KeyDown( ByVal sender As Object, ByVal e As KeyEventArgs) Handles TextBox1.KeyDown
If (e.KeyCode = Keys.Enter) Then
Navigate(toolStripTextBox1.Text)
End If
End Sub
' mouse üzerindeyken balon açıklama
' mouse üzerindeyken balon açıklama
Dim Hovering As Boolean
Private Sub Label1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseHover
ToolTip1.SetToolTip(Me.Label1, "www.google.com")
ToolTip1.SetToolTip(Me.Label2, "100 Sonuçlu Google Araması")
ToolTip1.SetToolTip(Me.Label3, "mail.live.com")
ToolTip1.SetToolTip(Me.Label4, "mail.yahoo.com")
ToolTip1.SetToolTip(Me.Label5, "www.facebook.com/")
ToolTip1.SetToolTip(Me.Label6, "www.giveawayoftheday.com/")
ToolTip1.SetToolTip(Me.Label7, "kerkur.tr.gg/BanaMailatin.htm")
ToolTip1.SetToolTip(Me.Label8, "www.diyanet.gov.tr/ namazvakti")
Hovering = True
End Sub
Dim Hovering As Boolean
Private Sub Label1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseHover
ToolTip1.SetToolTip(Me.Label1, "www.google.com")
ToolTip1.SetToolTip(Me.Label2, "100 Sonuçlu Google Araması")
ToolTip1.SetToolTip(Me.Label3, "mail.live.com")
ToolTip1.SetToolTip(Me.Label4, "mail.yahoo.com")
ToolTip1.SetToolTip(Me.Label5, "www.facebook.com/")
ToolTip1.SetToolTip(Me.Label6, "www.giveawayoftheday.com/")
ToolTip1.SetToolTip(Me.Label7, "kerkur.tr.gg/BanaMailatin.htm")
ToolTip1.SetToolTip(Me.Label8, "www.diyanet.gov.tr/ namazvakti")
Hovering = True
End Sub
butun girilen internet adresleri hatırlar form load a konur.adres çubuğu için
butun girilen internet adresleri hatırlar form load a konur.adres çubuğu için
TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
TextBox1.AutoCompleteSource = AutoCompleteSource.AllUrl
TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
TextBox1.AutoCompleteSource = AutoCompleteSource.AllUrl
SADECE SAYI GİRİLSİN TEXTBOX A
SADECE SAYI GİRİLSİN TEXTBOX A
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Char.IsNumber(e.KeyChar) = False Then
e.Handled = True
End If
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Char.IsNumber(e.KeyChar) = False Then
e.Handled = True
End If
End Sub
inputbox
inputbox ekrana veri istemeni sağlar
anadi.Text = InputBox(b & "Anne Adı 'nı Giriniz Tamam 'a Basın")
anadi.Text = InputBox(b & "Anne Adı 'nı Giriniz Tamam 'a Basın")
Tarih yazdırma
Tarih yazdırma
Dim d2 As String
Dim m2 As String
Dim y4 As String
Tarih = Now
d2 = DatePart("d", Tarih)
m2 = DatePart("m", Tarih)
y4 = DatePart("yyyy", Tarih)
DT.Text = d2 - 1 & "." & m2 & "." & y4
TT.Text = d2 & "." & m2 & "." & y4
Dim d2 As String
Dim m2 As String
Dim y4 As String
Tarih = Now
d2 = DatePart("d", Tarih)
m2 = DatePart("m", Tarih)
y4 = DatePart("yyyy", Tarih)
DT.Text = d2 - 1 & "." & m2 & "." & y4
TT.Text = d2 & "." & m2 & "." & y4
bu ise adres id ine adres.txt den dolacak Webbrowser da
bu ise adres id ine adres.txt den dolacak Webbrowser da.
RSWeb.Document.GetElementById("tAdres").Focus()
RSWeb.Document.ActiveElement.InnerText() = Adres.Text
RSWeb.Document.GetElementById("tAdres").Focus()
RSWeb.Document.ActiveElement.InnerText() = Adres.Text
seç ve tıkla web butonu webbrowser için
seç ve tıkla web butonu webbrowser için
RSWeb.Document.GetElementById("id").Focus()
RSWeb.Document.GetElementById("id").InvokeMember("click")
RSWeb.Document.GetElementById("id").Focus()
RSWeb.Document.GetElementById("id").InvokeMember("click")
* Pencere sabit Kalması için ayarları
* Pencere sabit Kalması için ayarları
MaximizeBox=False
AutoSizeMode=GroveAndShrink
MaximizeBox=False
AutoSizeMode=GroveAndShrink
* Belli bir süre sonra mesala 5 sn sonra işe devam için
* Belli bir süre sonra mesala 5 sn sonra işe devam için
timerc.start()
yazılır (timer.interval=1000 olmalı 1 sn karşılık gelir)
(timerc_Tick içinde ise)
Dim sayac as integer
On Error Resume Next
timerc.Interval = 1000
sayac = sayac + 1
SAYA.Text = sayac 'istersek
If serisayac = "5" = True Then
(5 sn dolunca yapılması gereken iş)
timerc.stop () (sonunda timerc.stop yazıp durduruyoruz)
End if
timerc.start()
yazılır (timer.interval=1000 olmalı 1 sn karşılık gelir)
(timerc_Tick içinde ise)
Dim sayac as integer
On Error Resume Next
timerc.Interval = 1000
sayac = sayac + 1
SAYA.Text = sayac 'istersek
If serisayac = "5" = True Then
(5 sn dolunca yapılması gereken iş)
timerc.stop () (sonunda timerc.stop yazıp durduruyoruz)
End if
* Bazı Komutlar
* Bazı Komutlar
a1.Visible = False (a1 in görünmesini gizler ama çalışır.)
a1.Visible = True (a1 in görünmesini sağlar.)
Timer1.Start () "timer1 başlatır.
Timer1.Stop () "timer1 durdurur.
a1.Visible = False (a1 in görünmesini gizler ama çalışır.)
a1.Visible = True (a1 in görünmesini sağlar.)
Timer1.Start () "timer1 başlatır.
Timer1.Stop () "timer1 durdurur.
* 1 Hata olursa Program kapanmasın görmezden gelsin hatayı
* 1 Hata olursa Program kapanmasın görmezden gelsin hatayı diye başa konulur.
On Error Resume Next
On Error Resume Next
macro yada program çalıştırmak için kod
macro yada program çalıştırmak için kod
Shell("TASI\Sorvar.exe", 1)
__________________________
Shell("TASI\Sorvar.exe", 1)
__________________________
web sayfası error vermemesi için hatakodu vermemesi için kod
web sayfası error vermemesi için hatakodu vermemesi için kod
WebBrowser1.ScriptErrorsSuppressed = True
________________________________________
WebBrowser1.ScriptErrorsSuppressed = True
________________________________________
kapat düğmesine tıklanınca (X) çıkacakmısın diye soru sorması için
kapat düğmesine tıklanınca (X) çıkacakmısın diye soru sorması için kod a dim le tanıtılır.
Dim a As String
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Beep()
a = MsgBox("Çıkmak istediğinizden emin misiniz?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Kerkur prog ismi")
If a = vbYes Then
Else
e.Cancel = True
Me.WindowState = FormWindowState.Normal
End If
End Sub
Dim a As String
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Beep()
a = MsgBox("Çıkmak istediğinizden emin misiniz?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Kerkur prog ismi")
If a = vbYes Then
Else
e.Cancel = True
Me.WindowState = FormWindowState.Normal
End If
End Sub
* örnek Kronometre
* örnek Kronometre
Public Class Form1
' Değişkenleri tanımlama
Dim d As Object
Dim a, b As Object
Dim c As Short
Private Sub Button2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button2.Click
a = 0
b = 0
c = 0
Label1.Text = "00:00:00"
Timer1.Stop()
End Sub
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
a = 0
b = 0
c = 0
Label1.Text = "00:00:00"
End Sub
Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick
Timer1.Interval = 1
c = c + 1
If b = 60 Then
a = a + 1
b = 0
End If
If c = 60 Then
b = b + 1
c = 0
End If
Label1.Text = Str(a) & ":" & Str(b) & ":" & Str(c)
DefInstance.Text = "Kronometre " & TimeOfDay
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Select Case Button1.Text
Case "baslat"
Timer1.Enabled = True
Button1.Text = "durdur"
Case "durdur"
Timer1.Enabled = False
Button1.Text = "baslat"
End Select
End Sub
End Class
Public Class Form1
' Değişkenleri tanımlama
Dim d As Object
Dim a, b As Object
Dim c As Short
Private Sub Button2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button2.Click
a = 0
b = 0
c = 0
Label1.Text = "00:00:00"
Timer1.Stop()
End Sub
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
a = 0
b = 0
c = 0
Label1.Text = "00:00:00"
End Sub
Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick
Timer1.Interval = 1
c = c + 1
If b = 60 Then
a = a + 1
b = 0
End If
If c = 60 Then
b = b + 1
c = 0
End If
Label1.Text = Str(a) & ":" & Str(b) & ":" & Str(c)
DefInstance.Text = "Kronometre " & TimeOfDay
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Select Case Button1.Text
Case "baslat"
Timer1.Enabled = True
Button1.Text = "durdur"
Case "durdur"
Timer1.Enabled = False
Button1.Text = "baslat"
End Select
End Sub
End Class
* SELECT CASE Örnek;
* SELECT CASE Örnek;
Private Sub Command1_Click()
puan = InputBox("Notunuzu Giriniz")
Select Case puan
Case 100
MsgBox ("Bravo 100 almışsınız. Ödül kazandınız")
Case 90 To 99
MsgBox ("Pekiyi ile geçtiniz")
Case 80 To 89
MsgBox ("iyi ile geçtiniz")
Case 70 To 79
MsgBox ("orta ile geçtiniz")
Case 60 To 69
MsgBox ("Geçerle geçtiniz")
Case Is < 60
MsgBox ("kaldınız")
Case Else
MsgBox ("yanlış sayı girdiniz")
End Select
End Sub
Private Sub Command1_Click()
puan = InputBox("Notunuzu Giriniz")
Select Case puan
Case 100
MsgBox ("Bravo 100 almışsınız. Ödül kazandınız")
Case 90 To 99
MsgBox ("Pekiyi ile geçtiniz")
Case 80 To 89
MsgBox ("iyi ile geçtiniz")
Case 70 To 79
MsgBox ("orta ile geçtiniz")
Case 60 To 69
MsgBox ("Geçerle geçtiniz")
Case Is < 60
MsgBox ("kaldınız")
Case Else
MsgBox ("yanlış sayı girdiniz")
End Select
End Sub
* txt dat gibi istediğin uzantılı dosyadan veri çağırmak
* txt dat gibi istediğin uzantılı dosyadan veri çağırmak
If txtPassword.Text Then
Dim FILENAME As String = "txtPassword.dat"
Dim objReader As New System.IO.StreamReader(FILENAME)
txtPassword.Text = objReader.ReadToEnd
objReader.Close()
End If
_______________
If txtPassword.Text Then
Dim FILENAME As String = "txtPassword.dat"
Dim objReader As New System.IO.StreamReader(FILENAME)
txtPassword.Text = objReader.ReadToEnd
objReader.Close()
End If
_______________
* txt dat gibi istediğin uzantılı dosyalara veri kaydetmek
* txt dat gibi istediğin uzantılı dosyalara veri kaydetmek
(txtPassword_TextChanged gibi üzrine tıklayınce değiştirme gibi komuta koydum)
Dim FILENAME As String = "txtPassword.dat"
Try
Dim objWriter As New System.IO.StreamWriter(FILENAME)
objWriter.WriteLine(txtPassword.Text.ToString)
objWriter.Close()
Catch ex As Exception
End Try
(txtPassword_TextChanged gibi üzrine tıklayınce değiştirme gibi komuta koydum)
Dim FILENAME As String = "txtPassword.dat"
Try
Dim objWriter As New System.IO.StreamWriter(FILENAME)
objWriter.WriteLine(txtPassword.Text.ToString)
objWriter.Close()
Catch ex As Exception
End Try
* Tanımlamaları bu şekilde bir arada yapılabiliyor
* Tanımlamaları bu şekilde bir arada yapılabiliyor
#Region "TANIMLAMALAR"
Dim a As String
#End Region
'birden fazla tanımlama koyulabilir
#Region "TANIMLAMALAR"
Dim a As String
#End Region
'birden fazla tanımlama koyulabilir
* Değişken Tanımları
* Değişken Tanımları
Dim yas As Byte 'gibi Byte: 0-255 değer arasında pozitif sayı değeri alır.
String: Karakter ifadeleri (sayı olmayan,sayıda alır) (1kb)
Integer: ± 32768 sayısına kadar tam sayı değeri alır (2kb)
Variant: Bütün değişkenlerin yerini alır. , Date: Tarih değeri alır.
Dim yas As Byte 'gibi Byte: 0-255 değer arasında pozitif sayı değeri alır.
String: Karakter ifadeleri (sayı olmayan,sayıda alır) (1kb)
Integer: ± 32768 sayısına kadar tam sayı değeri alır (2kb)
Variant: Bütün değişkenlerin yerini alır. , Date: Tarih değeri alır.
Microsoft® Visual Studio® 2010 Express _ ilk önce siteden programı indiriyoruz
http://www.microsoft.com/express/Downloads/#2010-Visual-Basic
Microsoft® Visual Studio® 2010 Express
program express olduğundan bedava dır.lisans gerektirmez.bedava register kayıt yapılmalıdır.
indirip kurduktan sonra altta direkt linki var. göndereceğim kodları ve siteleri,programları deniyebilirsiniz.
sitesinden english dilini seçin yada
Buradan direkt indirin
http://www.microsoft.com/express/
Microsoft® Visual Studio® 2010 Express
program express olduğundan bedava dır.lisans gerektirmez.bedava register kayıt yapılmalıdır.
indirip kurduktan sonra altta direkt linki var. göndereceğim kodları ve siteleri,programları deniyebilirsiniz.
sitesinden english dilini seçin yada
Buradan direkt indirin
http://www.microsoft.com/express/
Kaydol:
Kayıtlar (Atom)