Advertisement
DrAungWinHtut

Beginner Codes 2

Feb 9th, 2022
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.01 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace _2022020801PhotoAlbum2
  12. {
  13.     public partial class frmPhotoAlbum : Form
  14.     {
  15.         public frmPhotoAlbum()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void btnHidePhoto_Click(object sender, EventArgs e)
  21.         {
  22.             picAlbum.Visible = false;
  23.         }
  24.  
  25.         private void btnShowPhoto_Click(object sender, EventArgs e)
  26.         {
  27.             picAlbum.Visible=true;
  28.         }
  29.  
  30.         private void hidePhotoToolStripMenuItem_Click(object sender, EventArgs e)
  31.         {
  32.             picAlbum.Visible = false;
  33.         }
  34.  
  35.         private void showPhotoToolStripMenuItem_Click(object sender, EventArgs e)
  36.         {
  37.             picAlbum.Visible = true;
  38.         }
  39.  
  40.         private void exitToolStripMenuItem_Click(object sender, EventArgs e)
  41.         {
  42.             Application.Exit();
  43.         }
  44.  
  45.         private void btnChangePhoto_Click(object sender, EventArgs e)
  46.         {
  47.             picAlbum.Image = Image.FromFile("D:\\microbit.png");
  48.         }
  49.  
  50.         private void btnChangePhoto2_Click(object sender, EventArgs e)
  51.         {
  52.             picAlbum.Image = Image.FromFile("D:\\kid.jpg");
  53.         }
  54.  
  55.         private void cboFileName_SelectedIndexChanged(object sender, EventArgs e)
  56.         {
  57.            picAlbum .Image = Image.FromFile ( cboFileName.SelectedItem.ToString());
  58.         }
  59.  
  60.         private void btnSayHello_Click(object sender, EventArgs e)
  61.         {
  62.             // MessageBox.Show("Hello World");
  63.             // MessageBox.Show("Hello World","Greeting from GH");
  64.             MessageBox.Show("Hello World", "Greeting from GH",MessageBoxButtons.YesNo);
  65.         }
  66.  
  67.         private void btnSayNameHello_Click(object sender, EventArgs e)
  68.         {
  69.             MessageBox.Show("Hello "+ txtUname .Text );
  70.         }
  71.     }
  72. }
  73.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement