#Region " IMPORT.. " Imports System.Media Imports Microsoft.Win32 Imports System.IO #End Region Public Class Anafrm #Region " DEĞİŞKENLER.." Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer Private Const SETDESKWALLPAPER As Integer = &H14 Private Const UPDATEINIFILE = &H1 Private SabitDeskPaper As String Private S_OtoSure As String Private dakika As Integer Private Yaz As IO.StreamWriter Private Oku As IO.StreamReader #End Region #Region " FORM OLAYLARI.." Public Sub AyarSakla() SaveSetting(Application.ProductName, ProductName, "SabitDeskPaper", SabitDeskPaper) If ListBox1.SelectedIndex = -1 Or SecilenSatirTS.Text = -1 Then ListBox1.SelectedIndex = -1 SaveSetting(Application.ProductName, ProductName, "Seçilen Satır", ListBox1.SelectedIndex) SaveSetting(Application.ProductName, ProductName, "Seçilen Oto Süre", S_OtoSure) End Sub Private Sub Anafrm_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed End End Sub Private Sub Anafrm_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown 'formun Load bölümünde veya özelliklerinde (Keypreview = TRUE) yapılmalıdır 'ESC ile kapat If e.KeyCode = Keys.Escape Then Call AyarSakla() NotifyIcon1.Dispose() Application.Exit() End If End Sub Private Sub DuvarKagidiFrm_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing TrayaEkleBtnTs.PerformClick() e.Cancel = True End Sub Private Sub AnaFrm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Try Timer2.Start() TraydaGosterTSmn.Enabled = True FormuGosterTSmn.Enabled = False PnlOtoAyar.Visible = GetSetting(Application.ProductName, ProductName, "OtoAyar Paneli Göster", True) SureBelirleCmb.Text = GetSetting(Application.ProductName, ProductName, "Otomatik Süre Belirle", 5) S_OtoSure = GetSetting(Application.ProductName, ProductName, "Seçilen Oto Süre", "Dakika") ilkSesYok = True 'Başlarken option seçiminde ses vermesin Select Case S_OtoSure Case "Dakika" DakikaOpBtn.Checked = True Case "Saatlik" SaatOpBtn.Checked = True End Select Me.ShowInTaskbar = False If My.Computer.Network.IsAvailable = False Then WebdeAraTS.Enabled = False Else WebdeAraTS.Enabled = True End If ' SabitDeskPaper = GetSetting(Application.ProductName, ProductName, "SabitDeskPaper", "Genişlet") If SabitDeskPaper = "Genişlet" Then GenisletOpBtn.Checked = True ElseIf SabitDeskPaper = "Ortala" Then OrtalaOpBtn.Checked = True ElseIf SabitDeskPaper = "Döşe" Then DoseOpBtn.Checked = True End If Dim dosya As String = Application.StartupPath & "\" & "DuvarKagidiListesi.txt" If dosya <> Nothing Then ListBox1.Items.Clear() Call ListeYukle() ListeyiSaklaTS.Enabled = True ListedenYukleTS.Enabled = True ListeyiSilTS.Enabled = True ListBox1.SelectedIndex = GetSetting(Application.ProductName, ProductName, "Seçilen Satır", 0) If ListBox1.SelectedIndex = -1 Then ListBox1.SelectedIndex = 0 PictureBox1.ImageLocation = (Me.ListBox1.SelectedItem) End If ilkSesYok = False 'ses vermeye ayarla Catch ex As Exception 'MessageBox.Show("Liste Boş." & vbCrLf & "(Örnek Duvar Kağıdı) dizininden Seçiniz") '(ex.Message) ResimYukleTS.PerformClick() ListBox1.SelectedIndex = 0 'Me.ListBox1.Items.Count - 1 End Try End Sub #End Region #Region " LİSTE OLAYLARI.." Public Sub ListeYukle() Try Dim yol = Application.StartupPath & "\DuvarKagidiListesi.txt" Oku = New IO.StreamReader(yol, System.Text.Encoding.Default) While (Oku.Peek() > -1) RTrim(ListBox1.Items.Add(Oku.ReadLine)) End While Oku.Close() ListBox1.SelectedItem = +1 Catch ex As Exception 'MessageBox.Show(ex.Message) MessageBox.Show("(DuvarKagidiListesi.txt) Dosyası Bulunamadı" & vbCrLf & "(Örnek Duvar Kağıdı) dizininden" & vbCrLf & "Resim yükleyip Listeyi saklayın") End Try End Sub Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged PictureBox1.ImageLocation = (Me.ListBox1.SelectedItem) SecilenLBL.Text = PictureBox1.ImageLocation SecilenSatirTS.Text = Me.ListBox1.SelectedIndex No = Me.ListBox1.SelectedIndex 'Me.Text = No End Sub Private Sub ResimYukleTS_Click(sender As System.Object, e As System.EventArgs) Handles ResimYukleTS.Click 'Dim dosya As String 'Dim count As Integer 'Dim yol As String = Application.StartupPath & "\Örnek Duvar Kağıdı\" 'Dim uz As String = "*.jpg" 'dosya = Dir(yol, FileAttribute.Hidden) 'If dosya <> "" Then ' count = count + 1 'End If 'While dosya <> "" ' dosya = Dir() ' count = count + 1 ' ListBox1.Items.Add(yol) 'End While 'ListBox1.Items.AddRange(Directory.GetFiles(yol, uz, SearchOption.TopDirectoryOnly)) OpenFileDialog1.InitialDirectory = Application.StartupPath OpenFileDialog1.Filter = "Ressim Dosyaları|*.jpg;*.jpg|Tüm Dosyalar|*.*" If OpenFileDialog1.ShowDialog() = DialogResult.OK Then PictureBox1.Load(OpenFileDialog1.FileName) End If Dim file As String For Each file In OpenFileDialog1.FileNames ListBox1.Items.Add(file) Next 'Listeyi kendi klasöründe OTOMATİK sakla Dim DsyAdi As String = Application.StartupPath & "\DuvarKagidiListesi.txt" Yaz = New StreamWriter(DsyAdi, False, System.Text.Encoding.Default) Dim i As Integer For i = 0 To Me.ListBox1.Items.Count - 1 Yaz.WriteLine(Me.ListBox1.Items.Item(i)) Next Yaz.Close() End Sub Private Sub ListedenYukleTS_Click(sender As System.Object, e As System.EventArgs) Handles ListedenYukleTS.Click OpenFileDialog1.Filter = "Text Dosyaları|*.txt;*.txt|Tüm Dosyalar|*.*" OpenFileDialog1.InitialDirectory = Application.StartupPath OpenFileDialog1.FileName = Application.ExecutablePath & OpenFileDialog1.FileName OpenFileDialog1.FileName = "DuvarKagidiListesi.txt" If OpenFileDialog1.ShowDialog() = DialogResult.OK Then Oku = New IO.StreamReader(OpenFileDialog1.FileName) While (Oku.Peek() > -1) ListBox1.Items.Add(Oku.ReadLine) End While Oku.Close() End If End Sub Private Sub ListeyiSaklaTS_Click(sender As System.Object, e As System.EventArgs) Handles ListeyiSaklaTS.Click SaveFileDialog1.Filter = "Dosya Biçimi|*.txt;*.txt" SaveFileDialog1.InitialDirectory = Application.StartupPath SaveFileDialog1.FileName = "DuvarKagidiListesi.txt" If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then Dim Yol = SaveFileDialog1.FileName & "\DuvarKagidiListesi.txt" Yaz = New IO.StreamWriter(SaveFileDialog1.FileName, False, System.Text.Encoding.Default) Dim i As Integer For i = 0 To ListBox1.Items.Count - 1 Yaz.WriteLine(RTrim(ListBox1.Items.Item(i))) Next Yaz.Close() End If End Sub #End Region #Region " KOMUT BUTONLARINI TIKLAMA." Private Sub OtomatikDegissinTS_Click(sender As System.Object, e As System.EventArgs) Handles OtomatikDegissinTS.Click, OtomatikDegissinTSM.Click If PnlOtoAyar.Visible = False Then PnlOtoAyar.Visible = True PnlOtoAyar.BringToFront() ListBox1.BringToFront() Else PnlOtoAyar.Visible = False End If SaveSetting(Application.ProductName, ProductName, "OtoAyar Paneli Göster", PnlOtoAyar.Visible) End Sub Private Sub WebdeAraTS_Click(sender As System.Object, e As System.EventArgs) Handles WebdeAraTS.Click Dim url As String = "https://www.google.com/search?q=Wallpapers" Process.Start(url) End Sub #End Region #Region " SATIR SİLMEK. (Buton ve DEL tuşu ile)" Private Sub ListeyiSilTS_Click(sender As System.Object, e As System.EventArgs) Handles ListeyiSilTS.Click, ListeyiSilTSM.Click ListBox1.Items.Clear() SecilenSatirTS.Text = -1 End Sub Private Sub ListBox1_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseDown 'Seçili satır üstünde Farenin sağ tuşuna tıklanırsa seçili itemi duvar kağıdı yap If e.Button = Windows.Forms.MouseButtons.Right Then ListBox1_DoubleClick(sender, e) End If End Sub Private Sub ListBox1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown On Error Resume Next If e.KeyCode = Keys.Delete Then Call SatirSil() End If 'Sol ok tuşu ile EKLE yukarı-aşağı tuşu ile seç If e.KeyCode = Keys.Left Then ListBox1_DoubleClick(sender, e) End If End Sub Private Sub SatirSil() Dim secilecek, silinecek As Integer If ListBox1.SelectedIndex <= ListBox1.Items.Count - 1 Then silinecek = ListBox1.SelectedIndex secilecek = silinecek - 1 Me.ListBox1.Items.RemoveAt(silinecek) Me.ListBox1.SelectedIndex = secilecek End If If ListBox1.SelectedIndex = -1 And ListBox1.Items.Count - 1 >= 0 Then If silinecek = 0 Then Me.ListBox1.SetSelected(secilecek + 1, True) Exit Sub End If End If End Sub #End Region #Region " Ok tuşu ile (boyutunu), Enter tuşu ve DoubleClick ile DUVAR KAĞIDINI SABİTLEMEK .." Private Sub ListBox1_DoubleClick(sender As System.Object, e As System.EventArgs) Handles ListBox1.DoubleClick GenisletOpBtn.Checked = True If SabitDeskPaper = "Genişlet" Then GenisletOpBtn.Checked = True ElseIf SabitDeskPaper = "Ortala" Then OrtalaOpBtn.Checked = True ElseIf SabitDeskPaper = "Döşe" Then DoseOpBtn.Checked = True End If Call BtnOKOnayla() End Sub Public Sub BtnOKOnayla() Dim listdata As String listdata = Me.PictureBox1.ImageLocation Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop", True) If Me.GenisletOpBtn.Checked = CheckState.Unchecked And Me.OrtalaOpBtn.Checked = CheckState.Unchecked And Me.DoseOpBtn.Checked = CheckState.Unchecked Then MsgBox("Bir boyut seçiniz....") Exit Sub ElseIf Me.GenisletOpBtn.Checked = True Then key.SetValue("WallpaperStyle", "2") key.SetValue("TileWallpaper", "0") Call Me.SesVer() SystemParametersInfo(SETDESKWALLPAPER, 0, listdata, UPDATEINIFILE) ElseIf Me.OrtalaOpBtn.Checked = True Then key.SetValue("WallpaperStyle", "0") key.SetValue("TileWallpaper", "0") Call Me.SesVer() SystemParametersInfo(SETDESKWALLPAPER, 0, listdata, UPDATEINIFILE) ElseIf Me.DoseOpBtn.Checked = True Then key.SetValue("WallpaperStyle", "0") key.SetValue("TileWallpaper", "1") Call Me.SesVer() SystemParametersInfo(SETDESKWALLPAPER, 0, listdata, UPDATEINIFILE) End If End Sub Private Sub GenisletOpBtn_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles GenisletOpBtn.CheckedChanged, OrtalaOpBtn.CheckedChanged, DoseOpBtn.CheckedChanged If GenisletOpBtn.Checked = True Then SabitDeskPaper = "Genişlet" ElseIf OrtalaOpBtn.Checked = True Then SabitDeskPaper = "Ortala" ElseIf DoseOpBtn.Checked = True Then SabitDeskPaper = "Döşe" End If Call BtnOKOnayla() SaveSetting(Application.ProductName, ProductName, "SabitDeskPaper", SabitDeskPaper) End Sub #End Region #Region " OTOMATİK DUVAR KAĞIDI SÜRESİNİ OPTIONLARINDAN SEÇMEK VE BAŞLATMAK.." Private Sub S_BaslatBtn_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles S_BaslatBtn.MouseDown If e.Button = Windows.Forms.MouseButtons.Right Then Call ilerle() End If End Sub Private Sub DakikaOpBtn_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles DakikaOpBtn.CheckedChanged, SaatOpBtn.CheckedChanged If DakikaOpBtn.Checked = False And SaatOpBtn.Checked = False Then MsgBox("Hiçbir Değiştirme oranı seçilmedi.") Exit Sub ElseIf DakikaOpBtn.Checked = True Then S_OtoSure = "Dakika" ElseIf SaatOpBtn.Checked = True Then S_OtoSure = "Saatlik" End If End Sub Private Sub SureBelirleCmb_TextChanged(sender As System.Object, e As System.EventArgs) Handles SureBelirleCmb.TextChanged Timer1.Interval = SureBelirleCmb.Text.ToString LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Select Case SureBelirleCmb.Text Case 1 Timer1.Interval = 1000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 2 Timer1.Interval = 1000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" & SureBelirleCmb.Text & " Dakika" Case 3 Timer1.Interval = 3000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 4 Timer1.Interval = 4000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 5 Timer1.Interval = 5000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 10 Timer1.Interval = 10000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 15 Timer1.Interval = 15000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 20 Timer1.Interval = 20000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 25 Timer1.Interval = 25000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case 30 Timer1.Interval = 300000 LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" Case Else Timer1.Interval = SureBelirleCmb.Text.ToString LblInterval.Text = (SureBelirleCmb.Text * 1000) & " Interval" End Select DakikaOpBtn.Checked = True SaveSetting(Application.ProductName, ProductName, "Otomatik Süre Belirle", SureBelirleCmb.Text) End Sub #End Region #Region " TIMER OLAYLARI..." Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick Try No = Me.ListBox1.SelectedIndex If No = Me.ListBox1.Items.Count - 1 Then Me.ListBox1.SelectedIndex = 0 No = Me.ListBox1.SelectedIndex Else Call ilerle() End If Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Public Sub ilerle() On Error Resume Next If Me.ListBox1.Items.Count - 1 = -1 Then Exit Sub If Me.ListBox1.SelectedIndex < Me.ListBox1.Items.Count - 1 Then Me.ListBox1.SelectedIndex = Me.ListBox1.SelectedIndex + 1 Me.SecilenSatirTS.Text = Me.ListBox1.SelectedIndex If Me.ListBox1.SelectedIndex > Me.ListBox1.Items.Count - 1 Then Me.ListBox1.SelectedIndex = Me.ListBox1.Items.Count - 1 End If Else Me.ListBox1.SelectedIndex = 0 End If No = Me.ListBox1.SelectedIndex No = CStr(Me.ListBox1.Items.Item(No)) Call DuvarKagidiniUygula() S_SıfırlaBtn.PerformClick() End Sub Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs) Handles Timer2.Tick LblSaat.Text = CStr(TimeOfDay) End Sub #End Region #Region " NOTIFYICON İÇİN ContextMenu OLAYLARI..." #Region " NOTIFYICON İÇİN CLİCK OLAYI.." Private Sub TrayaEkleBtnTs_Click(sender As System.Object, e As System.EventArgs) Handles TrayaEkleBtnTs.Click TraydaGosterTSmn.Enabled = False FormuGosterTSmn.Enabled = True NotifyIcon1.Text = Me.Text NotifyIcon1.Visible = True Me.Visible = False Me.ShowInTaskbar = False Me.Hide() SureTSmn.Text = "Dakika : " & LbDakika.Text & " Saniye : " & LblSaniye.Text SaveSetting(Application.ProductName, ProductName, "NotifyIcon Trayda", NotifyIcon1.Visible) End Sub #End Region Private Sub TraydaGosterTSmn_Click(sender As System.Object, e As System.EventArgs) Handles TraydaGosterTSmn.Click TraydaGosterTSmn.Enabled = False FormuGosterTSmn.Enabled = True NotifyIcon1.Text = Me.Text NotifyIcon1.Visible = True Me.ShowInTaskbar = False Me.Visible = False Me.Hide() SureTSmn.Text = "Dakika : " & LbDakika.Text & " Saniye : " & LblSaniye.Text SaveSetting(Application.ProductName, ProductName, "NotifyIcon Trayda", NotifyIcon1.Visible) End Sub Private Sub FormuGosterTSmn_Click(sender As System.Object, e As System.EventArgs) Handles FormuGosterTSmn.Click TraydaGosterTSmn.Enabled = True FormuGosterTSmn.Enabled = False Me.Show() Me.WindowState = FormWindowState.Normal End Sub Private Sub UygulamadanCikTSmn_Click(sender As System.Object, e As System.EventArgs) Handles UygulamadanCikTSmn.Click Call AyarSakla() NotifyIcon1.Dispose() End End Sub #End Region #Region "BAŞLAT- UYGULA" Public Sub DuvarKagidiniUygula() Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Control Panel\Desktop", True) If SabitDeskPaper = "Genişlet" Then key.SetValue("WallpaperStyle", "2") key.SetValue("TileWallpaper", "0") Call SesVer() SystemParametersInfo(SETDESKWALLPAPER, 0, No, UPDATEINIFILE) ElseIf SabitDeskPaper = "Ortala" Then key.SetValue("WallpaperStyle", "0") key.SetValue("TileWallpaper", "0") Call SesVer() SystemParametersInfo(SETDESKWALLPAPER, 0, No, UPDATEINIFILE) ElseIf SabitDeskPaper = "Döşe" Then key.SetValue("WallpaperStyle", "0") key.SetValue("TileWallpaper", "1") Call SesVer() SystemParametersInfo(SETDESKWALLPAPER, 0, No, UPDATEINIFILE) End If End Sub #End Region #Region " SES OLAYLARI..." Public Sub SesVer() On Error Resume Next If ilkSesYok = True Then Exit Sub Dim splayer As New SoundPlayer(My.Resources.notify) splayer.Play() End Sub #End Region #Region " SAYAÇ İŞLEMLERİ.." Private Sub Timer3_Tick(sender As System.Object, e As System.EventArgs) Handles Timer3.Tick LblSaniye.Text = LblSaniye.Text + 1 If LblSaniye.Text = "60" Then LbDakika.Text = LbDakika.Text + 1 LblSaniye.Text = "00" If LbDakika.Text = SureBelirleCmb.Text Then 'And LblSaniye.Text = "00" Then LbDakika.Text = "00" LblSaniye.Text = "00" SureTSmn.Text = "Dakika : 00 Saniye : 00" Call ilerle() End If End If SureTSmn.Text = "Dakika : " & LbDakika.Text & " Saniye : " & LblSaniye.Text End Sub Private Sub S_BaslatBtn_Click(sender As System.Object, e As System.EventArgs) Handles S_BaslatBtn.Click Timer3.Start() Timer3.Enabled = True SureTSmn.Text = "Dakika : " & LbDakika.Text & " Saniye : " & LblSaniye.Text End Sub Private Sub S_DurdurBtn_Click(sender As System.Object, e As System.EventArgs) Handles S_DurdurBtn.Click Timer3.Stop() Timer3.Enabled = False End Sub Private Sub S_SıfırlaBtn_Click(sender As System.Object, e As System.EventArgs) Handles S_SıfırlaBtn.Click LbDakika.Text = "00" LblSaniye.Text = "00" SureTSmn.Text = "Dakika : 00 Saniye : 00" End Sub Private Sub S_BaslatBtn_MouseHover(sender As System.Object, e As System.EventArgs) Handles S_BaslatBtn.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(S_BaslatBtn, " Sağ Fare Tuşu ile Listede satır seç" & vbCrLf & "Süreyi başlat (Dakika)") End Sub Private Sub S_DurdurBtn_MouseHover(sender As System.Object, e As System.EventArgs) Handles S_DurdurBtn.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(S_DurdurBtn, "Süreyi Durdur (Dakika)") End Sub Private Sub S_SıfırlaBtn_MouseHover(sender As System.Object, e As System.EventArgs) Handles S_SıfırlaBtn.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(S_SıfırlaBtn, "Süreyi Sıfıla (00)") End Sub #End Region #Region " SAAT SEKMESİNDEİ İKONA TIKLAMA OLAYI..." Private Sub NotifyIcon1_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then If Me.Visible = False Then TraydaGosterTSmn.Enabled = True FormuGosterTSmn.Enabled = False Me.Show() Me.Focus() Else TraydaGosterTSmn.Enabled = False FormuGosterTSmn.Enabled = True Me.Hide() End If End If End Sub #End Region End Class
Modul :
Module Module1 Friend No = Anafrm.ListBox1.SelectedIndex Public ilkSesYok As Boolean = False End Module
Imports System.IO Public Class Form1 Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing SaveSetting(Application.ProductName, Application.ProductName, "kayıt sayısı", kayitSayisi_Lbl.Text.ToString) End Sub Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load LstEkleTxt.Focus() Call ListeYukle() ListBox1.HorizontalScrollbar = True End Sub Public Sub ListeYukle() ListBox1.Items.Clear() Yukle = New IO.StreamReader(ListeYolVeDsyAdi, System.Text.Encoding.Default) While (Yukle.Peek() > 0) Me.ListBox1.Items.Add(Yukle.ReadLine) kayitSayisi = kayitSayisi + 1 End While Yukle.Close() kayitSayisi_Lbl.Text = kayitSayisi End Sub Private Sub TxtOlarakSaklaBtn_Click(sender As System.Object, e As System.EventArgs) Handles TxtOlarakSaklaBtn.Click Try TextBox1.Text = "" Yukle = New IO.StreamReader(ListeYolVeDsyAdi, System.Text.Encoding.Default) While (Yukle.Peek() > 0) TextBox1.Text = TextBox1.Text & ", " & Yukle.ReadLine End While Yukle.Close() ' Textboxtaki metni Sakla My.Computer.FileSystem.WriteAllText(TextYolVeDsyAdi, TextBox1.Text, False, System.Text.Encoding.Default) Catch exp As Exception MessageBox.Show(exp.Message, "Hata oluştu..") End Try End Sub Private Sub ListeAcBtn_Click(sender As System.Object, e As System.EventArgs) Handles ListeAcBtn.Click On Error Resume Next TxtSilBtn.PerformClick() TextBox1.Clear() TextBox1.Text = IO.File.ReadAllText(TextYolVeDsyAdi, System.Text.Encoding.Default) End Sub Private Sub DosyaAcBtn_Click(sender As System.Object, e As System.EventArgs) Handles DosyaAcBtn.Click Try Dim openDLG As New OpenFileDialog openDLG.Filter = "Text Dosyaları (*.txt)|*.txt|Tüm Dosyalar (*.*)|*.*" openDLG.InitialDirectory = DsyYolu If openDLG.ShowDialog = DialogResult.OK Then Dim dosya As New System.IO.StreamReader(openDLG.FileName, System.Text.Encoding.Default) If openDLG.SafeFileName = "Liste.txt" Then Yukle = New IO.StreamReader(ListeYolVeDsyAdi, System.Text.Encoding.Default) While (Yukle.Peek() > 0) Me.ListBox1.Items.Add(Yukle.ReadLine) End While Yukle.Close() Exit Sub End If Dim str As String = dosya.ReadToEnd() TextBox1.Text = str dosya.Close() End If Catch exc As Exception MessageBox.Show(exc.Message, " Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub Private Sub ListeyeEkleBtn_Click(sender As System.Object, e As System.EventArgs) Handles ListeyeEkleBtn.Click ' LİSTEYE İSİM EKLEME If LstEkleTxt.Text = Nothing Or LstEkleTxt.Text = "BURAYA BİR İSİM GİRİN" Then LstEkleTxt.Text = "BURAYA BİR İSİM GİRİN" : LstEkleTxt.SelectAll() : Exit Sub ListBox1.Items.Add(LstEkleTxt.Text) kayitSayisi = (ListBox1.Items.Count - 1) + 1 kayitSayisi_Lbl.Text = kayitSayisi ListeSaklaBtn.Enabled = True LstEkleTxt.Text = "" End Sub Private Sub TxtSilBtn_Click(sender As System.Object, e As System.EventArgs) Handles TxtSilBtn.Click TextBox1.Text = Nothing End Sub Private Sub ListBox1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown On Error Resume Next If e.KeyCode = Keys.Delete Then Call SatirSil() ListeSaklaBtn.Enabled = True End If If e.KeyCode = Keys.F12 Then kayitSayisi_Lbl.Text = 0 kayitSayisi = 0 ListBox1.Items.Clear() End If If e.KeyCode = Keys.Escape Then Dim dosyaBoyut As IO.FileInfo dosyaBoyut = My.Computer.FileSystem.GetFileInfo(ListeYolVeDsyAdi) If TextBox1.TextLength > 0 Then TextBox1.Text = "" TextBox1.Text = "Dosyamızın Boyutu : " & dosyaBoyut.Length & " bayt" End If End If End Sub Private Sub SatirSil() On Error Resume Next Dim secilecek, silinecek, LS As Integer LS = Me.kayitSayisi_Lbl.Text.ToString() If ListBox1.SelectedIndex <= ListBox1.Items.Count - 1 Then silinecek = ListBox1.SelectedIndex secilecek = silinecek - 1 Me.ListBox1.Items.RemoveAt(silinecek) Me.ListBox1.SelectedIndex = secilecek Me.kayitSayisi_Lbl.Text.ToString() LS = LS - 1 Me.kayitSayisi_Lbl.Text = LS End If If ListBox1.SelectedIndex = -1 And ListBox1.Items.Count - 1 >= 0 Then If silinecek = 0 Then Me.ListBox1.SetSelected(secilecek + 1, True) Exit Sub End If End If If Me.kayitSayisi_Lbl.Text = -1 Then Me.kayitSayisi_Lbl.Text = 0 If Me.LblIndex.Text = -1 Then Me.LblIndex.Text = 0 End Sub Private Sub ListBox1_MouseHover(sender As System.Object, e As System.EventArgs) Handles ListBox1.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(ListBox1, "ListBoxtan satır Silmek için DELETE tuşunu kullanın") End Sub Private Sub ListeSaklaBtn_Click(sender As System.Object, e As System.EventArgs) Handles ListeSaklaBtn.Click ' LİSTEYİ SAKLA Dim dosyaBoyut As IO.FileInfo dosyaBoyut = My.Computer.FileSystem.GetFileInfo(ListeYolVeDsyAdi) If dosyaBoyut.Length <= 0 Then Me.Text = "Dosya Boyut: " & dosyaBoyut.Length & " bayt" Exit Sub End If Try Dim Yaz As StreamWriter Yaz = New StreamWriter(ListeYolVeDsyAdi, False, System.Text.Encoding.Default) Dim i As Integer For i = 0 To Me.ListBox1.Items.Count - 1 Yaz.WriteLine(ListBox1.Items.Item(i)) Next Yaz.Close() Catch exp As Exception MessageBox.Show(exp.Message, "Hata oluştu.") End Try End Sub Private Sub LstEkleTxt_MouseHover(sender As System.Object, e As System.EventArgs) Handles LstEkleTxt.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(LstEkleTxt, "Text kutusuna Ad ve Soyad girip" & vbCrLf & "Listeye Eklemek için Entere Basınızt") End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click On Error Resume Next My.Computer.FileSystem.DeleteFile(Application.StartupPath & "\Liste.txt") My.Computer.FileSystem.CopyFile(Application.StartupPath & "\Liste_YDK.txt", Application.StartupPath & "\Liste.txt") '(kaynak dosya, hedef dosya) kayitSayisi = 0 Call ListeYukle() End Sub Private Sub ListeyiYedekleBtn_Click(sender As System.Object, e As System.EventArgs) Handles ListeyiYedekleBtn.Click Try Dim Yaz As StreamWriter Yaz = New StreamWriter(Application.StartupPath & "\Liste_YDK.txt", False, System.Text.Encoding.Default) Dim i As Integer For i = 0 To Me.ListBox1.Items.Count - 1 Yaz.WriteLine(ListBox1.Items.Item(i)) Next Yaz.Close() Catch exp As Exception MessageBox.Show(exp.Message, "Hata oluştu.") End Try End Sub Private Sub TxtOlarakSaklaBtn_MouseHover(sender As System.Object, e As System.EventArgs) Handles TxtOlarakSaklaBtn.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(TxtOlarakSaklaBtn, "Listeyi Text Olarak Sakla") End Sub Private Sub DosyaAcBtn_MouseHover(sender As System.Object, e As System.EventArgs) Handles DosyaAcBtn.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(DosyaAcBtn, "Liste ve text Dosyalarını gör") End Sub Private Sub ListeyiYedekleBtn_MouseHover(sender As System.Object, e As System.EventArgs) Handles ListeyiYedekleBtn.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(ListeyiYedekleBtn, "Listenin bir yedeğini Oluştur") End Sub Private Sub Button1_MouseHover(sender As System.Object, e As System.EventArgs) Handles Button1.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(Button1, "Yedek Listeden Yükle.") End Sub Private Sub ListeSaklaBtn_MouseHover(sender As System.Object, e As System.EventArgs) Handles ListeSaklaBtn.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(ListeSaklaBtn, "Listeye kayı ekledikten sonra sakla.") End Sub Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged On Error Resume Next Me.LblIndex.Text = ListBox1.SelectedIndex If ListBox1.Items.Count < kayitSayisi_Lbl.Text.ToString Then 'kayitSayisi_Lbl.Text.ToString ListeSaklaBtn.Enabled = True Else ListeSaklaBtn.Enabled = False End If End Sub End Class
Modul Kodları
Module Module1 Public DsyYolu As String = Application.StartupPath Public ListeDsyAdi As String = "\Liste.txt" Public ListeYolVeDsyAdi As String = DsyYolu & ListeDsyAdi Public TextDsyAdi As String = "\TxtListem.txt" Public TextYolVeDsyAdi As String = DsyYolu & TextDsyAdi Public Yukle As IO.StreamReader Public Yaz As IO.StreamWriter Public kayitSayisi As Integer End Module
' NOT: Yapılandır menüsünden\ "yapılandır islemlerDLL" kısmından DLL dosyası oluşturulur ' Uygulama Proejesine eklemek için \myProject\Özellikler\References\ Add kısmından DLL dosyasını buup yükleyin 'yeni projenizde "Import islemlerDLL" şeklinde dahil edin Public Class Islemler Dim Sonuc As Integer Function HesapMakinesi(ByVal IslemTuru As String, ByVal Sayi1 As Integer, ByVal Sayi2 As Integer) If IslemTuru = "Topla" Then Sonuc = Sayi1 + Sayi2 End If If IslemTuru = "Carp" Then Sonuc = Sayi1 * Sayi2 End If If IslemTuru = "Bol" Then Sonuc = Sayi1 / Sayi2 End If If IslemTuru = "Cikar" Then Sonuc = Sayi1 - Sayi2 End If Return Sonuc End Function End Class
DLL Uygulama kodları
Imports islemlerDLL Public Class Form1 Public Dll As New islemlerDLL.Islemler Public ilksayi As Integer Public ikincisayi As Integer Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load ilksayi = ilksayiTxt.Text.ToString ikincisayi = ikincisayitxt.Text.ToString Button5.PerformClick() ilksayiTxt.Select() End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Label1.Text = ilksayi & "+" & (ikincisayi) & " =" TextBox1.Text = (Dll.HesapMakinesi("Topla", ilksayi, ikincisayi)) End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Label2.Text = ilksayi & "X" & (ikincisayi) & " =" TextBox2.Text = (Dll.HesapMakinesi("Carp", ilksayi, ikincisayi)) End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Label3.Text = ilksayi & "/" & (ikincisayi) & " =" TextBox3.Text = (Dll.HesapMakinesi("Bol", ilksayi, ikincisayi)) ' Sayı küsüratlı ise Tam sayı olarak Yuvarlatılır Dim sayi1 As Double sayi1 = CDbl(TextBox3.Text) TextBox3.Text = sayi1 End Sub Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click Label4.Text = ilksayi & "-" & (ikincisayi) & " =" TextBox4.Text = (Dll.HesapMakinesi("Cikar", ilksayi, ikincisayi)) End Sub Private Sub ilksayiTxt_TextChanged(sender As System.Object, e As System.EventArgs) Handles ilksayiTxt.TextChanged On Error Resume Next ilksayi = ilksayiTxt.Text.ToString End Sub Private Sub ikincisayitxt_TextChanged(sender As System.Object, e As System.EventArgs) Handles ikincisayitxt.TextChanged On Error Resume Next ikincisayi = ikincisayitxt.Text.ToString End Sub Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click Button1.Enabled = False Button2.Enabled = False Button3.Enabled = False Button4.Enabled = False TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" ilksayiTxt.Text = "" ikincisayitxt.Text = "" Label1.Text = "" Label2.Text = "" Label3.Text = "" Label4.Text = "" ilksayiTxt.Select() End Sub Private Sub ilksayiTxt_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles ilksayiTxt.KeyDown, ikincisayitxt.KeyDown Button1.Enabled = True Button2.Enabled = True Button3.Enabled = True Button4.Enabled = True End Sub End Class
Computest Cihazları hakkında bilgi almak isterseniz burayı tıklayın
SES KAYIT VE EKRAN YAKALAMA v.1.0.0.1 PROJE KODUİNDİR
Program Mümkün olduğunca değişik ve program bütünlüğü göstermemekle birlikte örnek kodlar içermektedir.Amaç; kod arayanlara aradıklarını bir arada bulmalarını sağlamaktır. Programın, Çok kaliteli bir Ses kayıt yaptığı söylenemez. Önemli olan ilgilenenlerin aradığı kod örneğini bulmasıdır.
FORM1 KODLARI :
Imports System.Runtime.InteropServices Imports System.Text 'NOT: Kayıt aygıtlarından ses kartından veya hoparlör ayarlarını yapınız 'ses kaydını bilgisayarda çalan bir mp3 çalardan kaydetmesini istiyorsanız:Kayıt\SesKarışımı(Ses kartı) seçili olmalı 'konuştuğunuzu kaydetmek için :Kayıt\microfon seçili omalıdır Public Class MIDIfrm #Region " SES KAYDEDİCİ FONKSİYONU ve ProgressBar Function.." Declare Function ProgressBar Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer Public Sub Kaydedici(ByVal islem As String, ByVal Ses_Yolu As String, ByVal Dsy_ismi As String) If islem = "baslat" Then mciSendString("open new Type waveaudio Alias recsound", "", 0, 0) mciSendString("record recsound", "", 0, 0) ElseIf islem = "bitir" Then mciSendString("save recsound " & SesTamYolu & "/" & Dsy_ismi, "wav", 0, 0) mciSendString("close recsound ", "", 0, 0) End If End Sub #End Region #Region " mciSendString dll KİTAPLIĞI.." _ Private Shared Function mciSendString(ByVal command As String, ByVal buffer As StringBuilder, ByVal bufferSize As Integer, ByVal hwndCallback As IntPtr) As Integer End Function _ Private Shared Function mciSendString(ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer End Function #End Region #Region " FORM TAŞIMA DEĞİŞKENLERİ...." 'Form Taşıma Const i As Integer = &HA1 Const j As Integer = 2 #End Region #Region " FORM TAŞIMA...." Private Sub Form1_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles AnaSkinPic.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then Me.Capture = False 'Panelden,pictureden,textten,vb tut sürükle AnaSkinPic.Capture = False Dim msg As Message = Message.Create(Me.Handle, i, New IntPtr(j), IntPtr.Zero) Me.DefWndProc(msg) End If End Sub #End Region #Region " FORM OLAYLARI..." Private Sub MIDIfrm_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing SaveSetting(Application.ProductName, ProductName, "Secili Ekran Yolu", Secili_EkranYolu) SaveSetting(Application.ProductName, ProductName, "Secili Dosya Adı", EkranYakalamaDsyAdı) SaveSetting(Application.ProductName, ProductName, "Secili Dosya Uzantısı", EkranUzantısı) SaveSetting(Application.ProductName, ProductName, "Progress Bar Rengi", ProgresBarRengi) SaveSetting(Application.ProductName, ProductName, "Formu üstte tut", CheckBox1.Checked) SaveSetting(Application.ProductName, ProductName, "Yakalarken Beni Sakla", CheckBox5.Checked) SaveSetting(Application.ProductName, ProductName, "Form Mini-Midi seçimi", Me.Height) SaveSetting(Application.ProductName, ProductName, "Pencere pozisyonu-Ust", Me.Top) SaveSetting(Application.ProductName, ProductName, "Pencere pozisyonu-Sol", Me.Left) SaveSetting(Application.ProductName, ProductName, "Pencere pozisyonu Sakla", CheckBox2.Checked) SaveSetting(Application.ProductName, ProductName, "Yakala ve Göster", CheckBox3.Checked) SaveSetting(Application.ProductName, ProductName, "Tab İndex", TabControl1.SelectedIndex) End Sub Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load SaatTimer.Enabled = True Timer1.Enabled = False ProgressBar1.Value = 0 Secili_EkranYolu = GetSetting(Application.ProductName, ProductName, "Secili Ekran Yolu", "C:\Users\" & KullAdi & "\Desktop") Me.EkranDsyAdi.Text = GetSetting(Application.ProductName, ProductName, "Secili Dosya Adı", "YakalananEkran") ComboBox1.Text = GetSetting(Application.ProductName, ProductName, "Secili Dosya Uzantısı", "JPG") EkranTamYolTxt.Text = Secili_EkranYolu & "\" & EkranDsyAdi.Text & ComboBox1.Text SesTamYolu = GetSetting(Application.ProductName, ProductName, "Ses Dosyası yolu", "C:\Users\" & KullAdi & "\Desktop") Dsy_ismi = GetSetting(Application.ProductName, ProductName, "Ses Dosyası Adı", "Ses_Kaydi") Me.SesDosyaAdiTxt.Text = Dsy_ismi Ses_Yolu = SesTamYolu & "\" & Dsy_ismi SesDosyaYoluTxt.Text = Ses_Yolu ProgresBarRengi = GetSetting(Application.ProductName, ProductName, "Progress Bar Rengi", 1) CheckBox3.Checked = GetSetting(Application.ProductName, ProductName, "Yakala ve Göster", False) CheckBox5.Checked = GetSetting(Application.ProductName, ProductName, "Yakalarken Beni Sakla", True) TabControl1.SelectedIndex = GetSetting(Application.ProductName, ProductName, "Tab İndex", 0) CheckBox1.Checked = GetSetting(Application.ProductName, ProductName, "Formu üstte tut", True) CheckBox2.Checked = GetSetting(Application.ProductName, ProductName, "Pencere pozisyonu Sakla", False) If CheckBox2.Checked = True Then Me.Top = GetSetting(Application.ProductName, ProductName, "Pencere pozisyonu-Ust", 250) Me.Left = GetSetting(Application.ProductName, ProductName, "Pencere pozisyonu-Sol", 500) Else Me.Top = 250 Me.Left = 300 End If If ProgresBarRengi = 1 Then RadioButton1.Checked = True ElseIf ProgresBarRengi = 2 Then RadioButton2.Checked = True ElseIf ProgresBarRengi = 3 Then RadioButton3.Checked = True End If 'yukardaki ile aynı işlevi yapar 'Select Case ProgresBarRengi ' Case 1 : RadioButton1.Checked = True ' Case 2 : RadioButton2.Checked = True ' Case 3 : RadioButton3.Checked = True 'End Select 'User32 Dll sinde bulunan progressbar apisi çağrılıyor. 1=yeşil,2=kırmızı, 3=sarı 'ProgressBar(ProgressBar1.Handle, 1040, 2, 3) Normal ProgressBar(ProgressBar1.Handle, 1040, ProgresBarRengi, 0) ' Form mini veya midi açılacak '********************** Me.Height = GetSetting(Application.ProductName, ProductName, "Form Mini-Midi seçimi", 144) If Me.Height = 144 Then Me.Height = 372 Else Me.Height = 144 If Me.Height = 144 Then AltPic.Top = 131 Me.Height = 372 YukAsOkPic.Image = PncAcKapaimLst.Images("YukarıOK.png") Else Me.Height = 144 AltPic.Top = 144 YukAsOkPic.Image = PncAcKapaimLst.Images("aşağıyaOK.png") End If '********************** KayıtPic.Image = RECimList.Images("Durdur.png") LinkLabel1.Links.Add(0, LinkLabel1.Text.Length, "http://eraslancemil1.blogspot.com.tr/") End Sub #End Region #Region " MouseMove ve MouseLeave olayları ..." Private Sub BTNklsr_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles BTNklsr.MouseMove BTNklsr.Image = BTNimLst.Images("DügmeKlsr_R.png") End Sub Private Sub BTNklsr_MouseLeave(sender As System.Object, e As System.EventArgs) Handles BTNklsr.MouseLeave BTNklsr.Image = BTNimLst.Images("DügmeKlsr.png") End Sub Private Sub BTNfoto_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles BTNfoto.MouseMove BTNfoto.Image = BTNimLst.Images("DügmeFotoR.png") End Sub Private Sub BTNfoto_MouseLeave(sender As System.Object, e As System.EventArgs) Handles BTNfoto.MouseLeave BTNfoto.Image = BTNimLst.Images("DügmeFoto.png") End Sub Private Sub KapatPic_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles KapatPic.MouseMove KapatPic.Image = KptimList.Images("kapat_gri.png") End Sub Private Sub KapatPic_MouseLeave(sender As System.Object, e As System.EventArgs) Handles KapatPic.MouseLeave KapatPic.Image = KptimList.Images("kapat_orj.png") End Sub Private Sub MaxiPic_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles MaxiPic.MouseMove MaxiPic.Image = KptimList.Images("maxi_gri.png") End Sub Private Sub MaxiPic_MouseLeave(sender As System.Object, e As System.EventArgs) Handles MaxiPic.MouseLeave MaxiPic.Image = KptimList.Images("maxi_orj.png") End Sub Private Sub MiniPic_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles MiniPic.MouseMove MiniPic.Image = KptimList.Images("Mini_Gri.png") End Sub Private Sub MiniPic_MouseLeave(sender As System.Object, e As System.EventArgs) Handles MiniPic.MouseLeave MiniPic.Image = KptimList.Images("Mini_orj.png") End Sub Private Sub AltPncAcPic_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles AltPncAcPic.MouseMove AltPncAcPic.Image = PncAcKapaimLst.Images("AltPncAç-Gri.png") End Sub Private Sub AltPncAcPic_MouseLeave(sender As System.Object, e As System.EventArgs) Handles AltPncAcPic.MouseLeave AltPncAcPic.Image = PncAcKapaimLst.Images("AltPncAç.png") End Sub Private Sub YukAsOkPic_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles YukAsOkPic.MouseMove If Me.Height = 144 Then YukAsOkPic.Image = PncAcKapaimLst.Images("aşağıyaOK-Gri.png") Else YukAsOkPic.Image = PncAcKapaimLst.Images("YukarıOK_Gri.png") End If End Sub Private Sub YukAsOkPic_MouseLeave(sender As System.Object, e As System.EventArgs) Handles YukAsOkPic.MouseLeave If Me.Height = 144 Then YukAsOkPic.Image = PncAcKapaimLst.Images("aşağıyaOK.png") Else YukAsOkPic.Image = PncAcKapaimLst.Images("YukarıOK.png") End If End Sub Private Sub BilgisayarPic_MouseLeave(sender As System.Object, e As System.EventArgs) Handles BilgisayarPic.MouseLeave BilgisayarPic.Image = BTNimLst.Images("BilgisayarGri.png") End Sub Private Sub BilgisayarPic_MouseMove(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles BilgisayarPic.MouseMove BilgisayarPic.Image = BTNimLst.Images("Bilgisayar_R.png") End Sub #End Region #Region " BUTON TIKLAMA (Click) OLAYLARI..." Private Sub KapatPic_Click(sender As System.Object, e As System.EventArgs) Handles KapatPic.Click Me.Close() End Sub Private Sub MaxiPic_Click(sender As System.Object, e As System.EventArgs) Handles MaxiPic.Click YukAsOkPic_Click(sender, e) End Sub Private Sub MiniPic_Click(sender As System.Object, e As System.EventArgs) Handles MiniPic.Click Me.WindowState = FormWindowState.Minimized End Sub Private Sub KayıtPic_Click(sender As System.Object, e As System.EventArgs) Handles KayıtPic.Click Call KayitBaslat_Durdur() End Sub Public Sub KayitBaslat_Durdur() If kayıtta = False Then Label14.Visible = True Timer1.Enabled = True kayıtta = True Timer1.Start() KayıtAnimasyonPic.Visible = True ProgressBar1.Value = 0 ProgressBar1.Maximum = MaximumSureCmb.Text.ToString Label1.Text = "Ses Kayıt Ediliyor.." Kaydedici("baslat", "", "") Timer1.Interval = 1000 ProgressBar1.Visible = True KayıtPic.Image = RECimList.Images("kayıt_Akrm.png") Else kayıtta = False KayıtAnimasyonPic.Visible = False ProgressBar1.Value = 0 ProgressBar1.Visible = False KayıtPic.Image = RECimList.Images("Durdur.png") Kaydedici("bitir", Ses_Yolu, Dsy_ismi) Label1.Text = "Ses Kayıt Bitti.." Timer1.Stop() Timer1.Enabled = False Label14.Visible = False CalistirBtn.Enabled = True End If End Sub Private Sub YukAsOkPic_Click(sender As System.Object, e As System.EventArgs) Handles YukAsOkPic.Click, AltPncAcPic.Click If Me.Height = 144 Then AltPic.Top = 131 Me.Height = 372 YukAsOkPic.Image = PncAcKapaimLst.Images("YukarıOK.png") Else Me.Height = 144 AltPic.Top = 144 YukAsOkPic.Image = PncAcKapaimLst.Images("aşağıyaOK.png") End If End Sub #End Region #Region " ALT YORDAMLAR..." Public Sub OlusturulanDsyOku() ' ses yeri Try My.Computer.Audio.Play(Ses_Yolu, AudioPlayMode.Background) ' & "\" & Dsy_ismi Calisiyor = True Catch ex As Exception MsgBox(Ses_Yolu & Dsy_ismi & " Dosya Bulunamadı") End Try End Sub Private Sub BilgisayarPic_Click(sender As System.Object, e As System.EventArgs) Handles BilgisayarPic.Click Process.Start("explorer.exe", "/e,/select,c:") End Sub Private Sub BTNfoto_Click(sender As System.Object, e As System.EventArgs) Handles BTNfoto.Click Dim b As Bitmap = New Bitmap(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height) Dim g As Graphics = Graphics.FromImage(b) Dim s As Size = New Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height) If GizleChk.Checked Then If CheckBox5.Checked = True Then Me.Hide() End If Dim t As DateTime = Now.AddSeconds(1) Do : Application.DoEvents() Loop Until Now.Second >= t.Second g.CopyFromScreen(0, 0, 0, 0, s, CopyPixelOperation.SourceCopy) Me.Show() t = Nothing Else g.CopyFromScreen(0, 0, 0, 0, s, CopyPixelOperation.SourceCopy) End If pic.Image = b g.Dispose() b = Nothing Dim saveDlg As SaveFileDialog = New SaveFileDialog Dim dlgResult As DialogResult = New DialogResult pic.Image.Save(Secili_EkranYolu & "\" & EkranDsyAdi.Text & ComboBox1.Text) If CheckBox3.Checked = True Then izleBtn_Click(sender, e) End If izleBtn.Enabled = True End Sub Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Ses_Yolu = "" Dim FolderDlg As New FolderBrowserDialog FolderDlg.ShowNewFolderButton = True If (FolderDlg.ShowDialog() = DialogResult.OK) Then Ses_Yolu = FolderDlg.SelectedPath SaveSetting(Application.ProductName, ProductName, "Ses Dosyası yolu", Ses_Yolu) SesDosyaYoluTxt.Text = Ses_Yolu & "\" & SesDosyaAdiTxt.Text End If End Sub Private Sub EkrSaklaYoluBtn_Click(sender As System.Object, e As System.EventArgs) Handles EkrSaklaYoluBtn.Click Secili_EkranYolu = "" Dim FolderDlg As New FolderBrowserDialog FolderDlg.ShowNewFolderButton = True If (FolderDlg.ShowDialog() = DialogResult.OK) Then Secili_EkranYolu = FolderDlg.SelectedPath EkranTamYolTxt.Text = Secili_EkranYolu & "\" & EkranDsyAdi.Text & ComboBox1.Text End If End Sub Private Sub GezginleGosterBtn_Click(sender As System.Object, e As System.EventArgs) Handles GezginleGosterBtn.Click Try System.Diagnostics.Process.Start(Secili_EkranYolu) ' & "\" & EkranDsyAdi.Text & ComboBox1.Text) Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Private Sub izleBtn_Click(sender As System.Object, e As System.EventArgs) Handles izleBtn.Click Try System.Diagnostics.Process.Start(Secili_EkranYolu & "\" & EkranDsyAdi.Text & ComboBox1.Text) Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Private Sub BTNklsr_Click(sender As System.Object, e As System.EventArgs) Handles BTNklsr.Click Process.Start(Ses_Yolu) End Sub Private Sub CalistirBtn_Click(sender As System.Object, e As System.EventArgs) Handles CalistirBtn.Click If CalistirBtn.Text = "Çalıştır" Then Call OlusturulanDsyOku() CalistirBtn.Text = "Kapat" Else My.Computer.Audio.Stop() CalistirBtn.Text = "Çalıştır" End If End Sub Private Sub EkranYakalaBtn_Click(sender As System.Object, e As System.EventArgs) Handles EkranYakalaBtn.Click 'Ekran yakala BTNfoto_Click(sender, e) End Sub Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click Try Process.Start(SesDosyaYoluTxt.Text) Catch ex As Exception Dim sonuc As String sonuc = MessageBox.Show("( " & SesDosyaAdiTxt.Text & " )" & _ " Dosyası bulunamadı." & vbCrLf & SesTamYolu & " Klasörü açılsın mı ?", _ " Sakla?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, _ MessageBoxDefaultButton.Button1) If sonuc = Windows.Forms.DialogResult.Yes Then Process.Start(SesTamYolu) End If End Try End Sub Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click SesTamYolu = GetSetting(Application.ProductName, ProductName, "Ses Dosyası yolu", Ses_Yolu) Try Process.Start(SesTamYolu) Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub #End Region #Region " TİMER-COMBOBOX-LOSTFOCUS-CHECKED_CHANGE.." Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick On Error Resume Next ' Timer progress barı dolduracak şekilde ayarlanıyor. If ProgressBar1.Value < 500 Then ProgressBar1.Value += 1 Label14.Text = ProgressBar1.Value End If If ProgressBar1.Value >= SureCmb.Text.ToString * 60 Then Call KayitBaslat_Durdur() End If End Sub Private Sub SaatTimer_Tick(sender As System.Object, e As System.EventArgs) Handles SaatTimer.Tick Label12.Text = TimeOfDay End Sub Private Sub EkranDsyAdi_Validated(sender As System.Object, e As System.EventArgs) Handles EkranDsyAdi.Validated 'değişiklik işlemi (Validated) onaylanıyor Secili_EkranYolu = GetSetting(Application.ProductName, ProductName, "Secili Ekran Yolu", Secili_EkranYolu) EkranYakalamaDsyAdı = EkranDsyAdi.Text EkranTamYolTxt.Text = Secili_EkranYolu & "\" & EkranDsyAdi.Text & ComboBox1.Text End Sub Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged EkranUzantısı = ComboBox1.Text EkranTamYolTxt.Text = Secili_EkranYolu & "\" & EkranDsyAdi.Text & ComboBox1.Text End Sub Private Sub Dsy_ismiTxt_LostFocus(sender As Object, e As System.EventArgs) Handles SesDosyaAdiTxt.LostFocus SesTamYolu = GetSetting(Application.ProductName, ProductName, "Ses Dosyası yolu", Ses_Yolu) SesDosyaYoluTxt.Text = SesTamYolu & "\" & SesDosyaAdiTxt.Text Dsy_ismi = SesDosyaAdiTxt.Text End Sub Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked Then Me.TopMost = True Else Me.TopMost = False End If End Sub Private Sub LinkLabel1_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked If My.Computer.Network.IsAvailable = False Then MsgBox("Bilgisayarınız İnternete Bağlı Değil.") Exit Sub End If System.Diagnostics.Process.Start(e.Link.LinkData) End Sub Private Sub Label3_Click(sender As System.Object, e As System.EventArgs) Handles Label3.Click If My.Computer.Network.IsAvailable = False Then MessageBox.Show("Bilgisayarınız İnternete Bağlı Değil.") Exit Sub End If System.Diagnostics.Process.Start("mailto:eraslancemil@gmail.com") End Sub Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click Dim info As New ProcessStartInfo("mmsys.cpl") Process.Start(info) End Sub #End Region #Region " TOOLTIP AÇIKLAMALARI " Private Sub BilgisayarPic_MouseHover(sender As System.Object, e As System.EventArgs) Handles BilgisayarPic.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(BilgisayarPic, "Bilgisayarım" & vbCrLf & " Klasörünü Aç") End Sub Private Sub BTNklsr_MouseHover(sender As System.Object, e As System.EventArgs) Handles BTNklsr.MouseHover Dim tooltip As New ToolTip() Ses_Yolu = GetSetting(Application.ProductName, ProductName, "Ses Dosyası yolu", "C:\Users\" & KullAdi & "\Desktop") tooltip.SetToolTip(BTNklsr, Ses_Yolu & vbCrLf & " Klasörünü Aç") End Sub Private Sub BTNfoto_MouseHover(sender As System.Object, e As System.EventArgs) Handles BTNfoto.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(BTNfoto, "Ekranı Yakala" & vbCrLf & EkranTamYolTxt.Text & " 'e Kaydet") End Sub Private Sub KayıtPic_MouseHover(sender As System.Object, e As System.EventArgs) Handles KayıtPic.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(KayıtPic, "Ses Kayıt Başlat - Durdur." & vbCrLf & " ve Dosyayı Kaydet") End Sub Private Sub KayıtAnimasyonPic_MouseHover(sender As System.Object, e As System.EventArgs) Handles KayıtAnimasyonPic.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(KayıtAnimasyonPic, "Kayıt devamınca animasyon gösterilir") End Sub Private Sub AltPncAcPic_MouseHover(sender As System.Object, e As System.EventArgs) Handles AltPncAcPic.MouseHover Dim tooltip As New ToolTip() tooltip.SetToolTip(AltPncAcPic, "Alt Pencere Açılıp kapatılır" & vbCrLf & " Ayar menülerine ulaşılır") End Sub Private Sub Label1_MouseHover(sender As System.Object, e As System.EventArgs) Handles Label1.MouseHover If Label1.Text = Nothing Then Exit Sub Dim tooltip As New ToolTip() tooltip.SetToolTip(Label1, "Uyarıyı Gizlemek için Tıkla") End Sub #End Region #Region " RADIO BUTTON OLAYLARI.." Private Sub RadioButton1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton1.CheckedChanged ProgresBarRengi = 1 ProgressBar(ProgressBar1.Handle, 1040, ProgresBarRengi, 0) End Sub Private Sub RadioButton2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton2.CheckedChanged ProgresBarRengi = 2 ProgressBar(ProgressBar1.Handle, 1040, ProgresBarRengi, 0) End Sub Private Sub RadioButton3_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton3.CheckedChanged ProgresBarRengi = 3 ProgressBar(ProgressBar1.Handle, 1040, ProgresBarRengi, 0) End Sub Private Sub RadioButton6_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton6.CheckedChanged ProgressBar1.Style = ProgressBarStyle.Blocks GroupBox1.Enabled = True End Sub Private Sub RadioButton5_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton5.CheckedChanged ProgressBar1.Style = ProgressBarStyle.Continuous GroupBox1.Enabled = True End Sub Private Sub RadioButton4_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton4.CheckedChanged ProgressBar1.MarqueeAnimationSpeed = AnimasyonHiziCmb.Text.ToString ProgressBar1.Style = ProgressBarStyle.Marquee GroupBox1.Enabled = False End Sub #End Region #Region " RANDOM DOSYA ADI ÜRETME...." Private Sub Label10_Click(sender As System.Object, e As System.EventArgs) Handles Label10.Click RNDdosyaadiBtn.PerformClick() End Sub Private Sub RNDdosyaadiBtn_Click(sender As System.Object, e As System.EventArgs) Handles RNDdosyaadiBtn.Click SesTamYolu = GetSetting(Application.ProductName, ProductName, "Ses Dosyası yolu", Ses_Yolu) SesDosyaAdiTxt.Text = UCase(System.IO.Path.GetFileNameWithoutExtension(System.IO.Path.GetRandomFileName())) & ".wav" SesDosyaYoluTxt.Text = SesTamYolu & "\" & SesDosyaAdiTxt.Text Dsy_ismi = SesDosyaAdiTxt.Text SaveSetting(Application.ProductName, ProductName, "Ses Dosyası Adı", SesDosyaAdiTxt.Text) End Sub Private Sub Label9_Click(sender As System.Object, e As System.EventArgs) Handles Label9.Click EkranDsyAdi.Text = UCase(System.IO.Path.GetFileNameWithoutExtension(System.IO.Path.GetRandomFileName())) EkranTamYolTxt.Text = Secili_EkranYolu & "\" & EkranDsyAdi.Text & ComboBox1.Text EkranYakalamaDsyAdı = EkranDsyAdi.Text & ComboBox1.Text End Sub Private Sub Label1_MouseClick(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseClick Label1.Text = "" End Sub #End Region End Class
MODULE1 KODLARI
Module Module1 #Region " GENEL DEĞİŞKENLER..." Public KullAdi As String = SystemInformation.UserName Public Ses_Yolu As String ' = "C:\Users\" & KullAdi & "\Desktop\" ' "C:\Users\"& KullAdi & "\Favorites\" ' "C:\Users\" & KullAdi & "\Desktop\" '"G:\AA\BB\" ' C:\Users\Public\Music Public Dsy_ismi As String '= "Ses_Kaydi" Public Secili_EkranYolu As String ' = "C:\Users\" & KullAdi & "\Desktop" Public EkranYakalamaDsyAdı As String = "EkranResmi" Public EkranUzantısı As String ' = ".JPG" Public SesTamYolu As String Public ProgresBarRengi As Integer Public Calisiyor As Boolean = False Public kayıtta As Boolean = False 'Api fonksiyonu belirleniyor. progres barın rengini değiştirmek için 'User32 Dll sinde bulunan progressbar apisi çağrılıyor. 1=yeşil,2=kırmızı, 3=sarı 'ProgressBar(ProgressBar1.Handle, 1040, 2, 3) #End Region End Module
İkinci el araç alım satımında kullanılan cihazlar hakkında bilgi almak isterseniz burayı tıklayın
NOT : İnternet olduğu sürece gösterir
1- Bir tane VB.Net projesi oluşturun. 2- Projeye bir adet 'WebBrowser' ekleyin. Adını ' Tarayici ' olarak değiştirin. 3- Yeni bir metin dosyası açın ve aşağıdaki HTML kodlarını yapıştırın. 'Farklı Kaydet' seçeneğine tıklayın. 'Kayıt türü' olarak 'Tüm Dosyalar' seçin ve 'GoogleHarita.html' olarak kaydedin. veya buradan hazır indirin 4- 'GoogleHarita.html' dosyasını 'My Project' - 'Resources' kısmına sürükleyip ekleyin. 5- Son olarak projenin 'Load' kısmına Alttaki kodu kopyalayıp ekleyin;
Form_Load Kısmı
Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Try Tarayici.DocumentText = My.Resources.GoogleHarita Catch End Try End Sub End Class
HTML KODLARI :
<
HAZIR ÖRNEK KOD İNDİR SADECE EXE HARİTA (Kod ile ilgilenmeyenler için) İNDİR
PANOYA KOPYALAMA VE DEPOLAMA PROJESİ İNDİR CTRL +C Tuşları ile seçilmiş bir metin, Link veya Her türlü text Kopyalandığı yer PANO dur.Sonra CTRL+V tuşları ile bu bilgi istenilen yere yapıştırılır. Böylece metinleri tekrar yazmaktan kurtulmuş oluruz Bu işleme sıklıkla Link kopyalamak ve ilerde tekrar kullanmak amacıyla saklamak gerektiğinde başvurulur.. işte bu işlem için kısa bir program örneği.
Public Class Form1 Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick If Clipboard.ContainsText Then Label1.Visible = False Label2.Visible = True PanodakiTxt.Text = My.Computer.Clipboard.GetText Else Label1.Visible = True Label2.Visible = False End If End Sub Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim UygulamaYolu As String = Application.ExecutablePath() Clipboard.Clear() Timer1.Start() End Sub Private Sub PanoSilBtn_Click(sender As System.Object, e As System.EventArgs) Handles PanoSilBtn.Click Clipboard.Clear() PanodakiTxt.Text = "" Timer1.Start() End Sub Private Sub PanodakiTxt_TextChanged(sender As Object, e As System.EventArgs) Handles PanodakiTxt.TextChanged If PanodakiTxt.Text = "" Then Exit Sub End If ListBox1.Items.Add(My.Computer.Clipboard.GetText) End Sub Private Sub SatirKopyalaBtn_Click(sender As System.Object, e As System.EventArgs) Handles SatirKopyalaBtn.Click If (ListBox1.SelectedItem <> "") Then TextBox2.Text = ListBox1.SelectedItem ListBox1.Items.Remove(ListBox1.SelectedItem) Clipboard.SetText(TextBox2.Text) Else MessageBox.Show("Bir öğeyi seçmeniz gerekir") End If End Sub Private Sub GecmisiSil_Click(sender As System.Object, e As System.EventArgs) Handles GecmisiSil.Click ListBox1.Items.Clear() End Sub Private Sub DsySaklaBtn_Click(sender As System.Object, e As System.EventArgs) Handles DsySaklaBtn.Click Using SW As New IO.StreamWriter(Application.StartupPath & "\" & "ListBox1.txt", True, System.Text.Encoding.Default) For Each itm As String In Me.ListBox1.Items SW.WriteLine(itm) Next End Using End Sub Private Sub ListBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ListBox1.KeyDown On Error Resume Next If e.KeyCode = Keys.Delete Then Dim secilecek, silinecek As Integer If ListBox1.SelectedIndex <= ListBox1.Items.Count - 1 Then silinecek = ListBox1.SelectedIndex secilecek = silinecek - 1 Me.ListBox1.Items.RemoveAt(silinecek) Me.ListBox1.SelectedIndex = secilecek End If If ListBox1.SelectedIndex = -1 And ListBox1.Items.Count - 1 >= 0 Then If silinecek = 0 Then Me.ListBox1.SetSelected(secilecek + 1, True) Exit Sub End If End If End If End Sub Private Sub DosyayiAc_Click(sender As System.Object, e As System.EventArgs) Handles DosyayiAc.Click Process.Start("NotePad.exe", Application.StartupPath & "\" & "ListBox1.txt") End Sub End Class