4-§.C# dasturlash tilida MediaPlayer dasturini yaratish
Windows MediaPlayerning yangi xususiyatlaridan biri bu yangi "Hozir o'ynatilayotgan" video uchun ishlatiladigan ko'rinish (lekin musiqa uchun ham foydalanish mumkin). Shuningdek, siz "Hozir o'ynatilayotgan" pastki o'ng burchakdagi tugmani bosish orqali unga o'tishingiz mumkin .Yuqorida o'ng tomondagi "Hozir o'ynayapmiz" oynadagi bir xil tugmani bosish orqali orqaga qaytishingiz mumkin.
Videoni ijro etishda ushbu ko'rinish avtomatik ravishda paydo bo'ladi. To'liq ekranga o'tish uchun pastki o'ng tomondagi tugmani bosing. Sichqonchani bir necha soniya ushlab turgandan so'ng, ijro etishni boshqarish vositalari yo'qoladi.
Siz "Hozir o'ynayapmiz" ko'rinishi yoki “Kutubxonani ko'rish” uchun siz sichqonchani vazifalar panelidagi Windows Media Player ustiga olib borib, ijro etishni boshqarishingiz mumkin. Bu boshqaruv elementlarini va ekranni oldindan ko'rishni ochadi.
C# dasturlash tilida MediaPlayer dasturini tuzish uchun C# Visual Studioga kirib, unga quyidagilarni kiritamiz:
namespace MediaPlayer
{
partial class Form1
{
///
/// Kerakli dizayner o'zgaruvchisi.
///
private System.ComponentModel.IContainer components = null;
///
/// Foydalanilayotgan resurslarni tozalang.
///
///
to'g'ri, agar boshqariladigan resurslar yo'q qilinishi kerak bo'lsa; aks holda, yolg'on.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Dizaynerni qo'llab-quvvatlash uchun talab qilinadigan usul - o'zgartirmang /// kod muharriri bilan ushbu usulning mazmuni.
///
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.panel1 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.listBox1 = new System.Windows.Forms.ListBox();
this.tanlash = new System.Windows.Forms.Button();
this.axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.LimeGreen;
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(798, 49);
this.panel1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe UI Emoji", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(288, 4);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(174, 40);
this.label1.TabIndex = 1;
this.label1.Text = "MediaPlayer";
//
// pictureBox1
//
this.pictureBox1.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(758, 2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(38, 38);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// listBox1
//
this.listBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
this.listBox1.Font = new System.Drawing.Font("Segoe UI Emoji", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 17;
this.listBox1.Location = new System.Drawing.Point(517, 64);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(275, 327);
this.listBox1.TabIndex = 1;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
//
// tanlash
//
this.tanlash.BackColor = System.Drawing.Color.LimeGreen;
this.tanlash.FlatAppearance.BorderSize = 0;
this.tanlash.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
this.tanlash.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
this.tanlash.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.tanlash.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.tanlash.ForeColor = System.Drawing.Color.White;
this.tanlash.Location = new System.Drawing.Point(517, 413);
this.tanlash.Name = "tanlash";
this.tanlash.Size = new System.Drawing.Size(275, 44);
this.tanlash.TabIndex = 2;
this.tanlash.Text = "Qo\'shiq tanlash";
this.tanlash.UseVisualStyleBackColor = false;
this.tanlash.Click += new System.EventHandler(this.button1_Click);
//
// axWindowsMediaPlayer1
//
this.axWindowsMediaPlayer1.Enabled = true;
this.axWindowsMediaPlayer1.Location = new System.Drawing.Point(12, 64);
this.axWindowsMediaPlayer1.Name = "axWindowsMediaPlayer1";
this.axWindowsMediaPlayer1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWindowsMediaPlayer1.OcxState")));
this.axWindowsMediaPlayer1.Size = new System.Drawing.Size(499, 393);
this.axWindowsMediaPlayer1.TabIndex = 3;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(798, 469);
this.Controls.Add(this.axWindowsMediaPlayer1);
this.Controls.Add(this.tanlash);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.panel1);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Text = "Form1";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button tanlash;
private AxWMPLib.AxWindowsMediaPlayer axWindowsMediaPlayer1;
}
}
XULOSA
Malumki, kurs ishi yozishning asl maqsadi o’quvchini fan borasidagi olgan bilimlarini mustahkamlash va u borasida yangilik kiritish uchun yaxshi samara beradi. Yosh avlodni taffakkurini oshirish bilim saviyasini kuchaytirish borasida ularni qiziqishlarini inobatga olgan holda to’g’ri yo’naltira olish ularga o’z kasbini mutahasisi bo’lishi uchun ko’maklashish kerak.
Hozirgi zamonda yurtimizda Axborat Texnologiyalarini rivojlantirish yo’lida juda ko’p ishlar amalga oshirilmoqda. Bu borada davlatimiz kop ishlarni amalga oshirmoqda. Xususan ko’p joylarga dasturlash orqali ko’p loyihalarni oson va qulay bajarilyapti. Dasturlash chet davlatlarida anchagina rivojlangan masalan Amerika, Malayziya, Koreya, Hindiston. Hozirgi kunda har-xil dasturlash tillari mavjud C#, C++, Java, va hokozo. Shularning orasidan C# Windows muhitida ishlaydigan dastur tuzish uchun qulay vosita bo’lib,kompyuterda dastur yaratish ishlarini avtomatlashtiradi, xatoliklarni kamaytiradi va dastur tuzuvchi ishini kamaytiradi. C# dastur zamonaviy visual loyihalash texnalogiyasi asosida obyektga yo’naltirilgan dasturlash tili hisoblanadi. Men bu kurs ishini tayyorlash jarayonida C# dasturlash tilida dizayn bilan ishlash, dastur kodlarini yaratish, shu bilan birga algebra va geometriyani dasturlashga bog’liqligi bilan tanishib chiqdim.
Mazkur kurs ishidan oliy o’quv yurti talabalari ”Algoritmik tillar va dasturlash” fanini o’rganishda, algebraik va geometrik misol va masalalarni aynan C# dasturlash tiliga bog’lash uchun yo’llanmalar olishi hamda ma’lum bir bilim ko’nikmalarga ega bo’lishi mumkin.
Do'stlaringiz bilan baham: |