New Post has been published on kerkur Yazılımcılık ve internet Hizmetleri
New Post has been published on http://www.kerkurcom.tk/vb-c-da-programin-kapatildigi-yerden-kordinattan-acilmasi/
vb c# 'da Programin Kapatıldığı yerden kordinattan açılması
* vb c# ‘da Programin Kapatıldığı yerden kordinattan açılması - My Project kısmından Settings kısmına My.Settings öğeleri olarak text1 text2 mylocx mylocy 4 String ekliyoruz. form1 e 2 textbox ekliyoruz Kodu: Public Class Form1 Dim MYX As Integer Dim MYY As Integer ‘save settings Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing ‘çıkışta hatırla ekranın yerini MYX = Me.Location.X MYY = Me.Location.Y ‘ My.Settings.text1 = TextBox1.Text My.Settings.text2 = TextBox2.Text My.Settings.mylocx = MYX My.Settings.mylocy = MYY End Sub ‘load settings Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load TextBox1.Text = My.Settings.text1 TextBox2.Text = My.Settings.text2 ‘ Alt satır önemli herzaman hatırladığından ilk mylocx ve mylocy ‘ boş geleceğinden program çalışmaz kesin yazılmalı If My.Settings.mylocx = “” Or My.Settings.mylocx = “” Then My.Settings.mylocx = “0″ My.Settings.mylocx = “0″ Else Me.Location = New Point(My.Settings.mylocx, My.Settings.mylocy) End If End Sub End Class >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //load settings private void Form1_Load(object sender, EventArgs e) textBox1.Text = Properties.Settings.Default.mylocx; textBox2.Text = Properties.Settings.Default.mylocy; // Alt satır önemli herzaman hatırladığından ilk mylocx ve mylocy // boş geleceğinden program çalışmaz kesin yazılmalı MessageBox.Show(Properties.Settings.Default.text1); if (string.IsNullOrEmpty(Properties.Settings.Default.mylocx) //save settings private void Form1_FormClosing(object sender, FormClosingEventArgs e) int MYX; int MYY; //çıkışta hatırla ekranın yerini MYX = this.Location.X; MYY = this.Location.Y; // Properties.Settings.Default.text1 = textBox1.Text; Properties.Settings.Default.text2 = textBox2.Text; Properties.Settings.Default.mylocx = Convert.ToString(MYX); Properties.Settings.Default.mylocy = Convert.ToString(MYY); Properties.Settings.Default.Save(); // Important for saving —————————————————— ——————————————————












