PDA

View Full Version : ایراد این کد در کجاست که برنامه کار نمیکند



docendo
دوشنبه 18 دی 1391, 18:14 عصر
این عکس از settings



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using test1.Properties;

namespace test1
{
public partial class Main : Form
{

public Main()
{

InitializeComponent();
//
this.cmbfrom.SelectedIndex = 27;
// this.comboBox3.SelectedValue = comboBox3.SelectedText;
// this.Size = new Size(630, 490);
// Properties.Setting.Default.Text_ComboBox = cmbto.SelectedItem().ToString();//a


}
private void Main_Load(object sender, EventArgs e)
{
comboBox2.SelectedValue = Properties.Settings.Default.combo1;
comboBox3.SelectedValue = Properties.Settings.Default.combo2;
// Set window location
if (Settings.Default.WindowL != null)
{
this.Location = Settings.Default.WindowL;
}

// Set window size
if (Settings.Default.WindowSize != null)
{
this.Size = Settings.Default.WindowSize;
}
}

private void Main_FormClosing(object sender, FormClosingEventArgs e)
{
Properties.Settings.Default.combo1 = comboBox2.SelectedIndex;
Properties.Settings.Default.combo2 = comboBox3.SelectedIndex;
Properties.Settings.Default.Save();
// Copy window location to app settings
Settings.Default.WindowL = this.Location;

// Copy window size to app settings
if (this.WindowState == FormWindowState.Normal)
{
Settings.Default.WindowSize = this.Size;
}
else
{
Settings.Default.WindowSize = this.RestoreBounds.Size;
}

// Save settings
Settings.Default.Save();
}

docendo
دوشنبه 18 دی 1391, 18:16 عصر
درضمن با SelectedValue و SelectedIndex هر دو کار کردم جواب نداد