Using System; using System. Collections. Generic; using


private void saveAsToolStripMenuItem_Click



Download 0,75 Mb.
bet4/6
Sana26.04.2022
Hajmi0,75 Mb.
#582493
1   2   3   4   5   6
Bog'liq
O\'quv amaliyot eldorga

private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
// we can also use savefile
using (SaveFileDialog sfd = new SaveFileDialog() { Filter = "TextDocument|*.txt", ValidateNames = true })
{
if (sfd.ShowDialog() == DialogResult.OK)
{
using (StreamWriter sw = new StreamWriter(sfd.FileName))
{
sw.WriteLineAsync(richTextBox1.Text);
}
}
}
}

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString(richTextBox1.Text, richTextBox1.Font, Brushes.Black, 12, 10);
}

private void richTextBox1_TextChanged(object sender, EventArgs e)
{
if (richTextBox1.Text.Length>0)
{
cutToolStripMenuItem.Enabled = true;
copyToolStripMenuItem.Enabled = false;
}
}

private void helpToolStripMenuItem_Click(object sender, EventArgs e)
{

}

private void Form1_Load(object sender, EventArgs e)


{

}
}
}





Tomchi.
/*
* Created by SharpDevelop.
* User: SHOXSANAMXON
* Date: 20.04.2022
* Time: 20:59
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace Tomchi_animatsiyasi


{

public partial class MainForm : Form
{
[DllImport("Gdi32.dll", EntryPoint="CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn(
int left,
int top,
int right,
int bottom,
int width,
int height
);
int [] rainSpeed={4, 6, 3, 5, 6, 7, 4};
int loadingSpeed=2;
float initialPercentage=0;

public MainForm()
{
InitializeComponent();
Region=System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 7, 7));
}
void MainFormLoad(object sender, EventArgs e)
{
timer1.Start();
timer2.Start();
}
void Timer1Tick(object sender, EventArgs e)
{
for (int i = 0; i <8; i++)
{
switch (i)
{
case 0:
pictureBox3.Location= new Point(pictureBox3.Location.X, pictureBox3.Location.Y + rainSpeed[i]);
if (pictureBox3.Location.Y>panel1.Size.Height+pictureBox3.Size.Height)
{
pictureBox3.Location=new Point(pictureBox3.Location.X, 0 -pictureBox3.Size.Height);
}
break;
case 1:
pictureBox4.Location= new Point(pictureBox4.Location.X, pictureBox4.Location.Y + rainSpeed[i]);
if (pictureBox4.Location.Y>panel1.Size.Height+pictureBox4.Size.Height)
{
pictureBox4.Location=new Point(pictureBox4.Location.X, 0 -pictureBox4.Size.Height);
}
break;
case 2:
pictureBox5.Location= new Point(pictureBox5.Location.X, pictureBox5.Location.Y + rainSpeed[i]);
if (pictureBox5.Location.Y>panel1.Size.Height+pictureBox5.Size.Height)
{
pictureBox5.Location=new Point(pictureBox5.Location.X, 0 -pictureBox5.Size.Height);
}
break;
case 3:
pictureBox6.Location= new Point(pictureBox6.Location.X, pictureBox6.Location.Y + rainSpeed[i]);
if (pictureBox6.Location.Y>panel1.Size.Height+pictureBox6.Size.Height)
{
pictureBox6.Location=new Point(pictureBox3.Location.X, 0 -pictureBox6.Size.Height);
}
break;
case 4:
pictureBox7.Location= new Point(pictureBox7.Location.X, pictureBox7.Location.Y + rainSpeed[i]);
if (pictureBox7.Location.Y>panel1.Size.Height+pictureBox7.Size.Height)
{
pictureBox7.Location=new Point(pictureBox7.Location.X, 0 -pictureBox7.Size.Height);
}
break;
case 5:
pictureBox8.Location= new Point(pictureBox8.Location.X, pictureBox8.Location.Y + rainSpeed[i]);
if (pictureBox8.Location.Y>panel1.Size.Height+pictureBox8.Size.Height)
{
pictureBox8.Location=new Point(pictureBox8.Location.X, 0 -pictureBox8.Size.Height);
}
break;
case 6:
pictureBox9.Location= new Point(pictureBox9.Location.X, pictureBox9.Location.Y + rainSpeed[i]);
if (pictureBox9.Location.Y>panel1.Size.Height+pictureBox9.Size.Height)
{
pictureBox9.Location=new Point(pictureBox9.Location.X, 0 -pictureBox9.Size.Height);
}
break;

}
}


}

void Timer2Tick(object sender, EventArgs e)
{
initialPercentage +=loadingSpeed;
float percentage=initialPercentage/pictureBox2.Height * 100;

label1.Text=(int)percentage + "%";

panel2.Location=new Point(panel2.Location.X, panel2.Location.Y+loadingSpeed);
if (panel2.Location.Y>pictureBox2.Location.Y+pictureBox2.Height)
{
label1.Text="100%";
this.timer2.Stop();
}
}
}
}



Download 0,75 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish