Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Button and Images
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Button and Images
Divers
Thread ID:
00946621
Message ID:
00946621
Vues:
59
How do i add an image to a base class button and have the image show up when i drop it on a form in the designer.

Since i can't set the properties through the properties window how do i do this in code.

This is what i have so far :
using System;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;

namespace Apps4u.WinApp.Controls.Buttons
{
	/// <summary>
	/// Summary description for a4uButtonGetFolder.
	/// </summary>
	public class a4uButtonGetFolder : Apps4u.WinApp.Controls.Buttons.a4uButton
	{
		public System.Windows.Forms.ImageList ButtonImageList;
		public System.ComponentModel.IContainer components;

		public a4uButtonGetFolder(System.ComponentModel.IContainer container)
		{
			///
			/// Required for Windows.Forms Class Composition Designer support
			///
			container.Add(this);
			container.Add(this.ButtonImageList);
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		public a4uButtonGetFolder()
		{
			///
			/// Required for Windows.Forms Class Composition Designer support
			///

			InitializeComponent();
			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}


		#region Component Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(a4uButtonGetFolder));
			this.ButtonImageList = new System.Windows.Forms.ImageList(this.components);
			// 
			// ButtonImageList
			// 
			this.ButtonImageList.ImageSize = new System.Drawing.Size(16, 16);
			this.ButtonImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ButtonImageList.ImageStream")));
			this.ButtonImageList.TransparentColor = System.Drawing.Color.Transparent;

			//
			// Button Properties
			//
			this.ImageIndex = 0;
			this.ImageList = this.ButtonImageList;
			this.Text = "";
		}
		#endregion
	}
}
Shawn Dorion
Geo Sektor Dot Com
Website: http://www.geosektor.com

Web Hosting Plans
Visit : http://WebHosting.Applications4u.com/
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform