當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.ImageList類代碼示例

本文整理匯總了C#中System.Windows.Forms.ImageList的典型用法代碼示例。如果您正苦於以下問題:C# ImageList類的具體用法?C# ImageList怎麽用?C# ImageList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ImageList類屬於System.Windows.Forms命名空間,在下文中一共展示了ImageList類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: assetsControlLoad

        void assetsControlLoad(object sender, EventArgs e)
        {
            if( Helper.IsInDesignMode )
            {
                return ;
            }

            var extensibility = ObjectFactory.GetInstance<IExtensibility>( ) ;
            var imageRepository=ObjectFactory.GetInstance<IImageRepository>( ) ;

            _imageList = imageRepository.CreateImageList( ) ;
            uiList.SmallImageList = _imageList ;

            var plugins = new List<IPlugin>();

            plugins.AddRange( extensibility.EditorPlugins );
            plugins.AddRange( extensibility.BehaviourPlugins );

            plugins.ForEach( p => imageRepository.Set( p.Icon ) );

            plugins.GroupBy( p => p.CategoryName ).Distinct( ).ForEach(
                grouping => _pluginsForCategories.Add( grouping.Key, new List<IPlugin>( ) ) ) ;

            plugins.ForEach( p=> _pluginsForCategories[p.CategoryName].Add( p ) );

            XElement xml = buildXml( ) ;

            populateTreeFromXml( xml ) ;
        }
開發者ID:jethac,項目名稱:oglr,代碼行數:29,代碼來源:AssetsControl.cs

示例2: FlatTabControl

        public FlatTabControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // double buffering
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

            bUpDown = false;

            this.ControlAdded += new ControlEventHandler(FlatTabControl_ControlAdded);
            this.ControlRemoved += new ControlEventHandler(FlatTabControl_ControlRemoved);
            this.SelectedIndexChanged += new EventHandler(FlatTabControl_SelectedIndexChanged);

            leftRightImages = new ImageList();
            //leftRightImages.ImageSize = new Size(16, 16); // default

            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FlatTabControl));
            Bitmap updownImage = ((System.Drawing.Bitmap)(resources.GetObject("TabIcons.bmp")));

            if (updownImage != null)
            {
                updownImage.MakeTransparent(Color.White);
                leftRightImages.Images.AddStrip(updownImage);
            }
        }
開發者ID:devfinity-fx,項目名稱:cpms_z,代碼行數:30,代碼來源:FlatTabControl.cs

示例3: InitializeComponent

		/// <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(RegistryBrowser));
			this.tvRegistry = new System.Windows.Forms.TreeView();
			this.ilTreeImages = new System.Windows.Forms.ImageList(this.components);
			this.SuspendLayout();
			// 
			// tvRegistry
			// 
			this.tvRegistry.Dock = System.Windows.Forms.DockStyle.Fill;
			this.tvRegistry.ImageList = this.ilTreeImages;
			this.tvRegistry.Name = "tvRegistry";
			this.tvRegistry.Size = new System.Drawing.Size(392, 333);
			this.tvRegistry.TabIndex = 0;
			this.tvRegistry.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tvRegistry_BeforeExpand);
			// 
			// ilTreeImages
			// 
			this.ilTreeImages.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
			this.ilTreeImages.ImageSize = new System.Drawing.Size(13, 13);
			this.ilTreeImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilTreeImages.ImageStream")));
			this.ilTreeImages.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// RegistryBrowser
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(392, 333);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.tvRegistry});
			this.Name = "RegistryBrowser";
			this.Text = "Registry Browser";
			this.ResumeLayout(false);

		}
開發者ID:ppatoria,項目名稱:SoftwareDevelopment,代碼行數:39,代碼來源:MAIN.CS

示例4: ActivityBindForm

 public ActivityBindForm(IServiceProvider serviceProvider, ITypeDescriptorContext context)
 {
     this.context = context;
     this.serviceProvider = serviceProvider;
     this.InitializeComponent();
     this.createProperty.Checked = true;
     this.helpTextBox.Multiline = true;
     IUIService service = (IUIService) this.serviceProvider.GetService(typeof(IUIService));
     if (service != null)
     {
         this.Font = (Font) service.Styles["DialogFont"];
     }
     ComponentResourceManager manager = new ComponentResourceManager(typeof(ActivityBindForm));
     this.ActivityBindDialogTitleFormat = manager.GetString("ActivityBindDialogTitleFormat");
     this.PropertyAssignableFormat = manager.GetString("PropertyAssignableFormat");
     this.DescriptionFormat = manager.GetString("DescriptionFormat");
     this.EditIndex = manager.GetString("EditIndex");
     this.PleaseSelectCorrectActivityProperty = manager.GetString("PleaseSelectCorrectActivityProperty");
     this.PleaseSelectActivityProperty = manager.GetString("PleaseSelectActivityProperty");
     this.IncorrectIndexChange = manager.GetString("IncorrectIndexChange");
     this.CreateNewMemberHelpFormat = manager.GetString("CreateNewMemberHelpFormat");
     this.memberTypes = new ImageList();
     this.memberTypes.ImageStream = (ImageListStreamer) manager.GetObject("memberTypes.ImageStream");
     this.memberTypes.TransparentColor = AmbientTheme.TransparentColor;
     this.properties = CustomActivityDesignerHelper.GetCustomProperties(context);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:26,代碼來源:ActivityBindForm.cs

示例5: ThreadsUI

        public ThreadsUI(PluginMain pluginMain, ImageList imageList)
        {
            this.pluginMain = pluginMain;

            lv = new ListView();
            lv.ShowItemToolTips = true;
            this.imageColumnHeader = new ColumnHeader();
            this.imageColumnHeader.Text = string.Empty;
            this.imageColumnHeader.Width = 20;

            this.frameColumnHeader = new ColumnHeader();
            this.frameColumnHeader.Text = string.Empty;

            lv.Columns.AddRange(new ColumnHeader[] {
            this.imageColumnHeader,
            this.frameColumnHeader});
            lv.FullRowSelect = true;
            lv.BorderStyle = BorderStyle.None;
            lv.Dock = System.Windows.Forms.DockStyle.Fill;

            lv.SmallImageList = imageList;
            runningImageIndex = imageList.Images.IndexOfKey("StartContinue");
            suspendedImageIndex = imageList.Images.IndexOfKey("Pause");

            lv.View = System.Windows.Forms.View.Details;
            lv.MouseDoubleClick += new MouseEventHandler(lv_MouseDoubleClick);
            lv.KeyDown += new KeyEventHandler(lv_KeyDown);
            lv.SizeChanged += new EventHandler(lv_SizeChanged);

            this.Controls.Add(lv);
        }
開發者ID:thecocce,項目名稱:flashdevelop,代碼行數:31,代碼來源:ThreadsUI.cs

示例6: ArrayList

        private ArrayList _imageLists = new ArrayList(); //will hold ImageList objects

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates an instance of <c>IconListManager</c> that will add icons to a single <c>ImageList</c> using the
        /// specified <c>IconSize</c>.
        /// </summary>
        /// <param name="imageList"><c>ImageList</c> to add icons to.</param>
        /// <param name="iconSize">Size to use (either 32 or 16 pixels).</param>
        public IconListManager(ImageList imageList, IconReader.IconSize iconSize)
        {
            // Initialise the members of the class that will hold the image list we're
            // targeting, as well as the icon size (32 or 16)
            _imageLists.Add(imageList);
            _iconSize = iconSize;
        }
開發者ID:modulexcite,項目名稱:ShareX_Google_Code,代碼行數:19,代碼來源:IconListManager.cs

示例7: FileStatusList

        public FileStatusList()
        {
            InitializeComponent(); Translate();
            SelectFirstItemOnSetItems = true;
            _noDiffFilesChangesDefaultText = NoFiles.Text;
            #if !__MonoCS__ // TODO Drag'n'Drop doesn't work on Mono/Linux
            FileStatusListView.MouseMove += FileStatusListView_MouseMove;
            FileStatusListView.MouseDown += FileStatusListView_MouseDown;
            #endif
            if (_images == null)
            {
                _images = new ImageList();
                _images.Images.Add(Resources.Removed); // 0
                _images.Images.Add(Resources.Added); // 1
                _images.Images.Add(Resources.Modified); // 2
                _images.Images.Add(Resources.Renamed); // 3
                _images.Images.Add(Resources.Copied); // 4
                _images.Images.Add(Resources.IconSubmoduleDirty); // 5
                _images.Images.Add(Resources.IconSubmoduleRevisionUp); // 6
                _images.Images.Add(Resources.IconSubmoduleRevisionUpDirty); // 7
                _images.Images.Add(Resources.IconSubmoduleRevisionDown); // 8
                _images.Images.Add(Resources.IconSubmoduleRevisionDownDirty); // 9
                _images.Images.Add(Resources.IconSubmoduleRevisionSemiUp); // 10
                _images.Images.Add(Resources.IconSubmoduleRevisionSemiUpDirty); // 11
                _images.Images.Add(Resources.IconSubmoduleRevisionSemiDown); // 12
                _images.Images.Add(Resources.IconSubmoduleRevisionSemiDownDirty); // 13
                _images.Images.Add(Resources.IconFileStatusUnknown); // 14
            }
            FileStatusListView.SmallImageList = _images;
            FileStatusListView.LargeImageList = _images;

            NoFiles.Visible = false;
            NoFiles.Font = new Font(SystemFonts.MessageBoxFont, FontStyle.Italic);
        }
開發者ID:neoandrew1000,項目名稱:gitextensions,代碼行數:34,代碼來源:FileStatusList.cs

示例8: ImageList

		static public ImageList ImageList()
		{
			Type t = typeof(SelectorImages);
			if (m_imageList == null)
				m_imageList = ImagesUtil.GetToolbarImageList(t, "ColorPickerCtrl.Resources.colorbarIndicators.bmp", new Size(12, 12), Color.Magenta);
			return m_imageList;
		}
開發者ID:Nullstr1ng,項目名稱:MultiRDPClient.NET,代碼行數:7,代碼來源:Images.cs

示例9: OnDrawItem

        /// <summary>
        /// Owner drawing listview item.
        /// </summary>
        protected void OnDrawItem( DrawItemEventArgs e, PluginListItem item )
        {
            e.DrawBackground();

            // IsRunnning bitmap
            const int imageWidth = 16+3;
            if(imageList==null)
                imageList = ((PluginDialog)Parent).ImageList;
            if(imageList!=null)
            {
                int imageIndex = item.PluginInfo.IsCurrentlyLoaded ? 0 : 1;
                imageList.Draw(e.Graphics, e.Bounds.Left+2, e.Bounds.Top+1, imageIndex);
            }

            // Name
            Rectangle bounds = Rectangle.FromLTRB(e.Bounds.Left+imageWidth,
                e.Bounds.Top, e.Bounds.Left+Columns[0].Width, e.Bounds.Bottom);
            using(Brush brush = new SolidBrush(e.ForeColor))
                e.Graphics.DrawString(item.Name, e.Font, brush, bounds);

            // Check box (Load at startup)
            bounds = Rectangle.FromLTRB(bounds.Right+1,
                bounds.Top, bounds.Right+Columns[1].Width+1, bounds.Bottom-1);
            ButtonState state = item.PluginInfo.IsLoadedAtStartup ? ButtonState.Checked : ButtonState.Normal;
            ControlPaint.DrawCheckBox(e.Graphics, bounds, state);
        }
開發者ID:paladin74,項目名稱:Dapple,代碼行數:29,代碼來源:PluginListView.cs

示例10: InitializeComponent

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatabaseTree));
            this.imageListIcon = new System.Windows.Forms.ImageList(this.components);
            this.SuspendLayout();
            // 
            // imageListIcon
            // 
            this.imageListIcon.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListIcon.ImageStream")));
            this.imageListIcon.TransparentColor = System.Drawing.Color.Transparent;
            this.imageListIcon.Images.SetKeyName(0, "servers.ico");
            this.imageListIcon.Images.SetKeyName(1, "sever.ico");
            this.imageListIcon.Images.SetKeyName(2, "db.ico");
            this.imageListIcon.Images.SetKeyName(3, "tables.ico");
            this.imageListIcon.Images.SetKeyName(4, "table.ico");
            this.imageListIcon.Images.SetKeyName(5, "view.ico");
            this.imageListIcon.Images.SetKeyName(6, "column.ico");
            this.imageListIcon.Images.SetKeyName(7, "procedure.ico");
            this.imageListIcon.Images.SetKeyName(8, "open.ico");
            this.imageListIcon.Images.SetKeyName(9, "refresh.png");
            this.imageListIcon.Images.SetKeyName(10, "delete.ico");
            this.imageListIcon.Images.SetKeyName(11, "property.png");
            this.imageListIcon.Images.SetKeyName(12, "generator.ico");
            // 
            // DatabaseTree
            // 
            this.ImageIndex = 0;
            this.ImageList = this.imageListIcon;
            this.LineColor = System.Drawing.Color.Black;
            this.SelectedImageIndex = 0;
            this.ResumeLayout(false);

        }
開發者ID:jojozhuang,項目名稱:Projects,代碼行數:34,代碼來源:DatabaseTree.cs

示例11: NotifyIconHelper

		/// <summary>
		/// 構造 NotifyIconHelper 的新實例。
		/// </summary>
		/// <param name="mainForm">應用程序主窗體。</param>
		/// <param name="notHandleClosingEvent">是否不讓 NotifyIconHelper 處理主窗體的 FormClosing 事件。
		/// <remarks>
		/// 缺省情況下此參數應為 False,即 NotifyIconHelper 總是通過處理主窗體的 FormClosing 事件達到讓主窗體在關閉後
		/// 駐留係統托盤區的目的。但特殊情況下,應用程序可能會自己處理主窗體的的 FormClosing 事件,此時應設置此屬性為 True。
		/// </remarks>
		/// </param>
		/// <param name="showPromptWhenClosing">是否在窗體關閉時給用戶以提示,僅當 NotHandleClosingEvent = False 時有效。</param>
		public NotifyIconHelper( Form mainForm, bool notHandleClosingEvent, bool showPromptWhenClosing )
		{
			_mainForm = mainForm;
			_showPromptWhenClosing = showPromptWhenClosing;

			_imgLst = new ImageList();
			_imgLst.Images.Add( _mainForm.Icon );

			Image img = Image.FromHbitmap( _mainForm.Icon.ToBitmap().GetHbitmap() );

			_contextMenu = new ContextMenuStrip();

			_contextMenu.Items.Add( new ToolStripMenuItem( Resources.MenuShowMainForm, img, OnShowMainForm ) );
			_contextMenu.Items.Add( new ToolStripSeparator() );
			_contextMenu.Items.Add( new ToolStripMenuItem( Resources.MenuExit, null, OnExitApp ) );

			_notifyIcon = new NotifyIcon();
			_notifyIcon.Icon = GetAppIcon();
			_notifyIcon.Text = _mainForm.Text;
			_notifyIcon.Visible = true;
			_notifyIcon.ContextMenuStrip = _contextMenu;
			_notifyIcon.MouseDown += _notifyIcon_MouseDown;

			_mainForm.FormClosed += _mainForm_FormClosed;

			if( notHandleClosingEvent == false )
				_mainForm.FormClosing += new FormClosingEventHandler( _mainForm_FormClosing );
		}
開發者ID:mengdongyue,項目名稱:CurrentWallPaper,代碼行數:39,代碼來源:NotifyIconHelper.cs

示例12: CodeCompletionDataProvider

		public CodeCompletionDataProvider() {
			// Create the image-list that is needed by the completion windows
			_imageList = new ImageList();
			//_imageList.Images.Add(Resources.TemplateIcon);
			//_imageList.Images.Add(Resources.FieldIcon);
			//_imageList.Images.Add(Resources.MethodIcon);
		}
開發者ID:sanyaade-fintechnology,項目名稱:SquareOne,代碼行數:7,代碼來源:CodeCompletionDataProvider.cs

示例13: FormFileHistory

        internal FormFileHistory(GitUICommands aCommands)
            : base(aCommands)
        {
            InitializeComponent();
            _asyncLoader = new AsyncLoader();
            // set tab page images
            {
                var imageList = new ImageList();
                tabControl1.ImageList = imageList;
                imageList.ColorDepth = ColorDepth.Depth8Bit;
                imageList.Images.Add(global::GitUI.Properties.Resources.IconViewFile);
                imageList.Images.Add(global::GitUI.Properties.Resources.IconDiff);
                imageList.Images.Add(global::GitUI.Properties.Resources.IconBlame);
                tabControl1.TabPages[0].ImageIndex = 0;
                tabControl1.TabPages[1].ImageIndex = 1;
                tabControl1.TabPages[2].ImageIndex = 2;
            }

            _filterBranchHelper = new FilterBranchHelper(toolStripBranchFilterComboBox, toolStripBranchFilterDropDownButton, FileChanges);
            _filterRevisionsHelper = new FilterRevisionsHelper(toolStripRevisionFilterTextBox, toolStripRevisionFilterDropDownButton, FileChanges, toolStripRevisionFilterLabel, ShowFirstParent, form: this);

            _formBrowseMenus = new FormBrowseMenus(FileHistoryContextMenu);
            _formBrowseMenus.ResetMenuCommandSets();
            _formBrowseMenus.AddMenuCommandSet(MainMenuItem.NavigateMenu, FileChanges.MenuCommands.GetNavigateMenuCommands());
            _formBrowseMenus.AddMenuCommandSet(MainMenuItem.ViewMenu, FileChanges.MenuCommands.GetViewMenuCommands());
            _formBrowseMenus.InsertAdditionalMainMenuItems(toolStripSeparator4);
        }
開發者ID:vbjay,項目名稱:gitextensions,代碼行數:27,代碼來源:FormFileHistory.cs

示例14: ImageListResourceEntryNode

		public ImageListResourceEntryNode(string key, ImageListStreamer data)
		{
			this.LazyLoading = true;
			this.key = key;
			this.data = new ImageList();
			this.data.ImageStream = data;
		}
開發者ID:JamesLinus,項目名稱:ILSpy,代碼行數:7,代碼來源:ImageListResourceEntryNode.cs

示例15: GetimageList

        public static ImageList GetimageList(int width, int height, DataTable imageNames)
        {
            ImageList imageList = new ImageList();
            imageList.ImageSize = new System.Drawing.Size(width, height);
            imageList.ColorDepth = ColorDepth.Depth32Bit;

            //imageList.Images.Add("selected", (Bitmap)Itop.Client.Resources.Properties.Resources.ResourceManager.GetObject("selected"));
            foreach (DataRow row in imageNames.Rows)
            {
                try
                {
                    object obj = Ebada.Scgl.Resource.Properties.Resources.ResourceManager.GetObject(row["ProgIco"] as string);
                    if (obj is Icon)
                    {
                        imageList.Images.Add(row["ProgIco"] as string, (Icon)obj);
                    }
                    else if (obj is Bitmap)
                    {
                        imageList.Images.Add(row["ProgIco"] as string, (Bitmap)obj);
                    }
                    else
                    {

                    }

                }
                catch (Exception exc)
                {
                    System.Diagnostics.Debug.WriteLine(exc.GetType().ToString() + " - " + exc.Message);
                }
            }

            return imageList;
        }
開發者ID:s7loves,項目名稱:mypowerscgl,代碼行數:34,代碼來源:ImageListRes.cs


注:本文中的System.Windows.Forms.ImageList類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。