Microsoft.WindowsAPI.Taskbar.TabbedThumbnail.SetWindowIcon C# (CSharp) Method

SetWindowIcon() public method

Sets the window icon for this thumbnail preview
public SetWindowIcon ( Icon icon ) : void
icon System.Drawing.Icon System.Drawing.Icon for the window/control associated with this preview
return void
        public void SetWindowIcon(Icon icon)
        {
            Icon = icon;

            // If we have a TaskbarWindow assigned, set its icon
            if (TaskbarWindow != null && TaskbarWindow.TabbedThumbnailProxyWindow != null)
            {
                TaskbarWindow.TabbedThumbnailProxyWindow.Icon = Icon;
            }
        }

Same methods

TabbedThumbnail::SetWindowIcon ( IntPtr iconHandle ) : void

Usage Example

Example #1
0
		private void CreateInstances() {

			for(int i = 0; i < _config.Accounts.Count; i++) {

				Account account = _config.Accounts[i];

				if(_instances.ContainsKey(account.Guid)) {
					continue;
				}

				Notifier notifier = new Notifier(account);
				notifier.FormClosed += _Notifier_FormClosed;
				notifier.CheckMailFinished += _Notifier_CheckFinished;

				_instances.Add(account.Guid, notifier);

				notifier.Show(this);

				TabbedThumbnail preview = new TabbedThumbnail(base.Handle, notifier.Handle);
				preview.TabbedThumbnailClosed += _Preview_TabbedThumbnailClosed;
				preview.SetWindowIcon(Resources.Icons.Window);
				preview.Tooltip = String.Empty;
				preview.Title = account.FullAddress;

				notifier.PreviewThumbnail = preview;

				_taskbarManager.TabbedThumbnail.AddThumbnailPreview(preview);
			}

			if(_config.Accounts.Count > 0) {
				Account account = _config.Accounts[0];
				_taskbarManager.TabbedThumbnail.SetActiveTab(_instances[account.Guid].Handle);
			}
		}