Zeby nie zasmiecac to mam jeszcze jeden problem: Gdzie wewalic kod aby sie wykonywal po pojawieniu sie calego okna programu? Chce zrobic progress bar ladowania plikow itd a jak zaladuje to go schowac i pokazac reszte komponentow, wewalalem wszedzi i byly 2 efekty: error lub formatka sie jeszcze nie pokazala xD daje kod:
[cpp]
/*
- Created by Paweł Jabłoński
- User: Demoh
- Date: 2006-08-24
- Time: 12:19
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
namespace xomag
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm
{
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void MainFormLoad(object sender, System.EventArgs e)
{
//tutaj wszystko startuje
//ladowanie pliku
//jesli nie ma to tworzymy pusty i 1 magazyn
//jesli jest to wczytujemy dane
//ustawiamy godzine
if(DateTime.Now.Minute > 9)
{
label1.Text = DateTime.Now.Day + "." + DateTime.Now.Month + "." + DateTime.Now.Year + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute;
}
else
{
label1.Text = DateTime.Now.Day + "." + DateTime.Now.Month + "." + DateTime.Now.Year + " " + DateTime.Now.Hour + ":0" + DateTime.Now.Minute;
}
Thread.Sleep(3000);
//chowamy ladowanie i pokazujemy program
tabControl1.Visible = true;
}
void TabPage1Click(object sender, System.EventArgs e)
{
}
void BackgroundWorker1DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
}
void ComboBox1SelectedIndexChanged(object sender, System.EventArgs e)
{
}
void ListView1SelectedIndexChanged(object sender, System.EventArgs e)
{
}
void Timer1Tick(object sender, System.EventArgs e)
{
if(DateTime.Now.Minute > 9)
{
label1.Text = DateTime.Now.Day + "." + DateTime.Now.Month + "." + DateTime.Now.Year + " " + DateTime.Now.Hour + ":" + DateTime.Now.Minute;
}
else
{
label1.Text = DateTime.Now.Day + "." + DateTime.Now.Month + "." + DateTime.Now.Year + " " + DateTime.Now.Hour + ":0" + DateTime.Now.Minute;
}
}
}
}[/cpp]