1 / 23

Visual Basic

Visual Basic. Windows Programlama. Konular. Değişken Tipleri Hata Yakalama Windows bileşenlerinin kullanılması Menu ve Toolbar oluşturma Yazdırma işlemleri Veri Tabanı işlemleri Grafik işlemleri. Private : Yerel Değişken tanımlamak için kullanılır.

zaynah
Download Presentation

Visual Basic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. VisualBasic Windows Programlama

  2. Konular • Değişken Tipleri • Hata Yakalama • Windows bileşenlerinin kullanılması • Menu ve Toolbar oluşturma • Yazdırma işlemleri • Veri Tabanı işlemleri • Grafik işlemleri

  3. Private : Yerel Değişken tanımlamak için kullanılır. Public : Global Değişken tanımlamak için kullanılır. Değişken Tipleri : Byte : 0 ile 255 arasında değer alır. Short : -32.768 ile 32.767 Integer : -2.147.483.648 ile 2.147.483.647 Long : -9.223.372.036.854.775.808 ile 9.223.372.036.854.775.807 Single : ±3.402823x1038 ile ±1.401298x10-45 Double : ±1.79769313486232x10308 ile ±4.94065645841247x10-324 Decimal : ±79.228.162.514.264.337.593.543.950.335 bütün basamaklar Boolean : 2 byte’lıkTrueFalse Char : 2 byte’lık karakter String : 2 milyar karaktere kadar atama yapar Date : 8 byte dır tarih ve saat içerir Object: pointer veri tipidir. Nesnenin bellekteki adresini gösterir.

  4. Değişken Tanımlama Dim x As Integer Dim x As Integer=5 Dim x As Integer=New Integer()

  5. Hata Yakalama Dim x As Integer Try x=“99a” Label1.Text=x Catch Label1.Text=“Hatalı değer ataması” EndTry

  6. Button Button1.BackgroundImage=Ctype(New Bitmap(“c:\resim\sekil1.jpg”),System.Drawing.Bitmap) ‘Resim alt ortada olsun Button1.ImageAlign=ContentAlignment.BottomCenter ‘Düğme düz olsun Button1.FlatStyle=FlatStyle.Flat ‘Enter tuşuna basıldığında düğme tıklansın Me.AcceptButton=Button1 ‘Metni hizalama Button1.TextAlign=ContentAlignment.BottomCenter

  7. Button1.TextAlign=ContentAlignment.BottomLeft Button1.TextAlign=ContentAlignment.BottomRight ‘Kısayol tuşu oluşturma Button1.Text=“&Kayıt” Alt+K PrivateSub Button1_Click(…) TextBox1.Text=“Not bilgisi” EndSub Label Label1.Text=“Düzeltme notu” Label1.Text=“&Düzeltme notu” Label1.TextAlign=ContentAlignment.BottomCenter LinkLabel1.Text=“www.microsoft.com”

  8. TextBox1.PasswordChar=“*” TextBox1.MaxLength=11 TextBox1.AutoSize=True TextBox1.Multiline=True TextBox1.ScrollBars=ScrollBars.Both TextBox1.WordWrap=True TextBox1.Clear() ya da TextBox1.Text=“” TextBox1.Copy() TextBox1.Cut() TextBox1.Undo() TextBox1.Paste()

  9. ListBox ListBox1.Items.Add(“Madde1”) ListBox1.Items.Add(TextBox1.Text) ListBox1.Items.Insert(1,“Madde2”) If ListBox1.Items.IndexOf(“Madde3”)>0 ThenMsgBox(“Aranılan eleman listede var”) ListBox1.Sorted=True ListBox1.Items.Clear() ListBox1.Items.Remove(0) ListBox1.Items.Count() ListBox1.SelectedIndex=0

  10. Liste içeriğini bir diziye kopyalama : Dim mydizi(10) As String Dim eleman As String ListBox1.Items.CopyTo(mydizi,0) ForEach eleman ınmydizi If eleman<>”” ThenConsole.WriteLine(eleman) Next

  11. ListBox1.MultiColumn=True Birden fazla eleman seçme : ListBox1.SelectionMode=SelectionMode.MultiSimple

  12. ComboBox ComboBox1.Items.Add(“Madde1”) ComboBox1.Items.Add(TextBox1.Text) ComboBox1.Items.Insert(1,“Madde2”) If ComboBox1.Items.IndexOf(“Madde3”)>0 ThenMsgBox(“Aranılan eleman listede var”) ComboBox1.Sorted=True ComboBox1.Items.Clear() ComboBox1.Items.Remove(0) ComboBox1.Items.Count()

  13. CheckedListBox1 CheckedListBox1.Items.Add(“Madde1”) CheckedListBox1.Items.Add(TextBox1.Text) CheckedListBox1.Items.Insert(1,“Madde2”) If CheckedListBox1.Items.IndexOf(“Madde3”)>0 ThenMsgBox(“Aranılan eleman listede var”) CheckedListBox1.Sorted=True CheckedListBox1.Items.Clear() CheckedListBox1.Items.Remove(0) CheckedListBox1.Items.Count() CheckedListBox1.CheckedItems.Count()

  14. RadioButton RadioButton1.Text=“Madde1” RadioButton1.TextAlign=ContentAlignment.BottomCenter If RadioButton1.CheckedThenMsgBox(“işaretli”) PictureBox PictureBox1.SizeMode= PictureBoxSizeMode.StretchImage Dim dy As String=“c:\resim\res1.jpg”) PictureBox1.Image=Image.FromFile(dy)

  15. Panel Panel1.Controls.Add(RadioButton1) Panel1.Controls.Add(RadioButton2) Panel1.Controls.Add(RadioButton3) Panel1.BorderStyle=BorderStyle.Fixed3D Panel1.BorderStyle=BorderStyle.FixedSingle Panel1.BorderStyle=BorderStyle.None Panel1.BackgroundImage=Image.FromFile(“c:\resim\resim.ico”)

More Related