Click here to Skip to main content
15,868,016 members
Home / Discussions / C#
   

C#

 
GeneralRe: Thread Abort Pin
LongRange.Shooter21-Jul-05 4:11
LongRange.Shooter21-Jul-05 4:11 
GeneralRe: Thread Abort Pin
Blue_Skye21-Jul-05 6:29
Blue_Skye21-Jul-05 6:29 
GeneralRe: Thread Abort Pin
S. Senthil Kumar21-Jul-05 6:37
S. Senthil Kumar21-Jul-05 6:37 
GeneralAbout threading Pin
Rassul Yunussov21-Jul-05 1:20
Rassul Yunussov21-Jul-05 1:20 
GeneralRe: About threading Pin
LongRange.Shooter21-Jul-05 4:17
LongRange.Shooter21-Jul-05 4:17 
GeneralRe: About threading Pin
Rassul Yunussov21-Jul-05 19:27
Rassul Yunussov21-Jul-05 19:27 
GeneralRe: About threading Pin
LongRange.Shooter22-Jul-05 5:02
LongRange.Shooter22-Jul-05 5:02 
GeneralRe: About threading Pin
Rassul Yunussov21-Jul-05 19:46
Rassul Yunussov21-Jul-05 19:46 
For example here is my code:
using System;
using System.Windows.Forms;
using System.Drawing;
namespace GeoObjects
{
	/// <summary>
	/// 
	/// </summary>
	
	
	public class GeoTOC : System.Windows.Forms.TreeView
	{
		private System.ComponentModel.IContainer components;
		private System.Windows.Forms.ImageList imageList_LayersColor;
		GeoMapControl m_pGeoMapControl;
		public GeoTOC()
		{
			// 
			// TODO: Add constructor logic here
			//
			InitializeComponent();
		}

		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.imageList_LayersColor = new System.Windows.Forms.ImageList(this.components);
			// 
			// imageList_LayersColor
			// 
			this.imageList_LayersColor.ImageSize = new System.Drawing.Size(16, 16);
			this.imageList_LayersColor.TransparentColor = System.Drawing.Color.Transparent;
			// 
			// GeoTOC
			// 
			this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.CheckBoxes = true;
			this.ImageIndex = 0;
			this.ImageList = this.imageList_LayersColor;
			this.SelectedImageIndex = 0;

		}
#region  Accessors
		public GeoMapControl MapControl
		{
			set
			{
				m_pGeoMapControl = value;
				m_pGeoMapControl.TOC = this;
			}
		}
#endregion
		public void UpdateTable()
		{
			this.BeginUpdate();
			Nodes.Clear();
			imageList_LayersColor.Images.Clear();
			System.Drawing.Bitmap img = new System.Drawing.Bitmap(16,16);
			Graphics g = Graphics.FromImage(img);
			g.Clear(Color.White);
			g.Dispose();
			imageList_LayersColor.Images.Add(img);
			foreach(GeoMapTable gmt in m_pGeoMapControl.MapTables)
			{
				TreeNode Map = Nodes.Add(gmt.Name);
				Map.Checked = gmt.Visible;
				Map.ForeColor = Color.Blue;
				foreach(GeoLayer gl in gmt.Layers)
				{
					img = new System.Drawing.Bitmap(16,16);
					g = Graphics.FromImage(img);
					g.Clear(Color.White);
					g.FillRectangle(new SolidBrush(gl.LayerColor),3,3,11,11);
					g.Dispose();
					imageList_LayersColor.Images.Add(img);
					TreeNode layer = Map.Nodes.Add(gl.Name);
					layer.Checked = gl.Visible;
					layer.ImageIndex = imageList_LayersColor.Images.Count-1;
					layer.SelectedImageIndex = imageList_LayersColor.Images.Count-1;
				}
			}
			this.EndUpdate();
		}
		protected override void OnAfterCheck(TreeViewEventArgs e)
		{
			TreeNode parent = e.Node.Parent;
			if(parent==null)
				((GeoMapTable)m_pGeoMapControl.MapTables[e.Node.Index]).Visible = e.Node.Checked;
			else
				((GeoLayer)((GeoMapTable)m_pGeoMapControl.MapTables[parent.Index]).Layers[e.Node.Index]).Visible = e.Node.Checked;
			m_pGeoMapControl.PaintMap();
			base.OnAfterCheck (e);
		}
	}
}

How can i make the method UpdateTable() in the thread???
GeneralRe: About threading Pin
Rassul Yunussov21-Jul-05 21:48
Rassul Yunussov21-Jul-05 21:48 
GeneralCreating a Gif file Pin
djing198520-Jul-05 23:34
djing198520-Jul-05 23:34 
GeneralRe: Creating a Gif file Pin
Libor Tinka21-Jul-05 0:05
Libor Tinka21-Jul-05 0:05 
GeneralRe: Creating a Gif file Pin
djing198521-Jul-05 0:33
djing198521-Jul-05 0:33 
GeneralRe: Creating a Gif file Pin
Yoyosh21-Jul-05 1:59
Yoyosh21-Jul-05 1:59 
GeneralRe: Creating a Gif file Pin
poucin10021-Jul-05 2:03
poucin10021-Jul-05 2:03 
GeneralRe: Creating a Gif file Pin
djing198521-Jul-05 4:25
djing198521-Jul-05 4:25 
GeneralIL code security Pin
Libor Tinka20-Jul-05 23:03
Libor Tinka20-Jul-05 23:03 
GeneralRe: IL code security Pin
Corinna John20-Jul-05 23:38
Corinna John20-Jul-05 23:38 
GeneralRe: IL code security Pin
Libor Tinka21-Jul-05 0:00
Libor Tinka21-Jul-05 0:00 
GeneralMDI Forms Pin
rmedo20-Jul-05 22:37
rmedo20-Jul-05 22:37 
GeneralRe: MDI Forms Pin
Dave Kreskowiak21-Jul-05 2:24
mveDave Kreskowiak21-Jul-05 2:24 
GeneralRe: MDI Forms Pin
rmedo21-Jul-05 2:25
rmedo21-Jul-05 2:25 
GeneralRe: MDI Forms Pin
Dave Kreskowiak21-Jul-05 4:36
mveDave Kreskowiak21-Jul-05 4:36 
GeneralRe: MDI Forms Pin
rmedo23-Jul-05 21:49
rmedo23-Jul-05 21:49 
GeneralRe: MDI Forms Pin
Dave Kreskowiak24-Jul-05 6:44
mveDave Kreskowiak24-Jul-05 6:44 
GeneralBackGroundImage in a RichTextBox Pin
fady_sayegh20-Jul-05 21:53
fady_sayegh20-Jul-05 21:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.