Click here to Skip to main content
15,891,136 members
Articles / Programming Languages / C#

Popup UserControl - KarubButton

Rate me:
Please Sign up or sign in to vote.
3.68/5 (11 votes)
1 Aug 2007CPOL 40K   1K   38  
Secure password input screen
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.IO;

namespace SifreKontrol
{
    public partial class UserControl1 : UserControl,Popup.IPopupUserControl
    {
        public UserControl1()
        {
            InitializeComponent();
            icon = button13.ButtonIcon;//ana icon değerini tutacak
        }

        bool yon = false;//varsayılan değeri false yani seçili değil
        Icon icon;

        #region IPopupUserControl Members

        public bool AcceptPopupClosing()
        {
            if (yon == true)
                return false;
            else
            {
                return true;
            }
        }

        #endregion


        private void button13_Click(object sender, EventArgs e)
        {
            if (yon == true)
            {
                button13.ButtonIcon = icon;
                yon = false;
            }
            else
            {
                System.Reflection.Assembly program = System.Reflection.Assembly.GetExecutingAssembly();
                Stream dosya = program.GetManifestResourceStream("SifreKontrol.Resources.305.ico");
                Icon resim = new Icon(dosya);
                dosya.Close();
                button13.ButtonIcon = resim;
                yon = true;
                dosya.Dispose();
                resim.Dispose();
            }
        }
       
        private void button12_Click(object sender, EventArgs e)
        {
            button13.ButtonIcon = icon;
            yon = false;
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) ARELTEK
Turkey Turkey
Since 1998...

MCPD - Enterprise Application Developer

“Hesaplı hareket ettiğini zanneden ve onunla iftihar eyliyen dar kafalar; kurtulmağa, yükselmeğe elverişli hiç bir eser vücüda getirmezler. Kurtuluş ve yükselişi, ancak varlığına dayanan ve mülkü milletin gizli kapalı hazinelerini verimli hale getirmesini bilen, şahsi menfaatini millet menfaati uğruna feda eden, ruhu idealist, dimağı realist şahsiyetlerde aramalıdır.”

Nuri Demirağ, 1947

Comments and Discussions