I copied the example
Compile is successful .net 2003
but i press button , nothing to show
but the example has box show up, why ? where 's wrong?
using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;
using Microsoft.Resea rch.CommunityTe chnologies.Tree map;
using System.Xml;
namespace treemap
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows. Forms.Form
{
private
Microsoft.Resea rch.CommunityTe chnologies.Tree map.TreemapCont rol
treemapControl1 ;
private System.Windows. Forms.Button build_button;
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.Containe r components = null;
public Form1()
{
InitializeCompo nent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.treemapCon trol1 = new
Microsoft.Resea rch.CommunityTe chnologies.Tree map.TreemapCont rol();
this.build_butt on = new System.Windows. Forms.Button();
this.SuspendLay out();
//
// treemapControl1
//
this.treemapCon trol1.BorderCol or =
System.Drawing. SystemColors.Wi ndowFrame;
this.treemapCon trol1.DiscreteN egativeColors = 20;
this.treemapCon trol1.DiscreteP ositiveColors = 20;
this.treemapCon trol1.FontFamil y = "Arial";
this.treemapCon trol1.FontSolid Color = System.Drawing. Color.Black;
this.treemapCon trol1.IsZoomabl e = false;
this.treemapCon trol1.Location = new System.Drawing. Point(88, 9);
this.treemapCon trol1.MaxColor = System.Drawing. Color.Green;
this.treemapCon trol1.MaxColorM etric = 100F;
this.treemapCon trol1.MinColor = System.Drawing. Color.Red;
this.treemapCon trol1.MinColorM etric = -100F;
this.treemapCon trol1.Name = "treemapControl 1";
this.treemapCon trol1.NodeLevel sWithText =
Microsoft.Resea rch.CommunityTe chnologies.Tree map.NodeLevelsW ithText.All;
this.treemapCon trol1.NodesXml = "<?xml version=\"1.0\"
encoding=\"utf-16\"?><Nodes xmlns:xsd=\"htt p://www.w3.org/2001/X" +
"MLSchema\" xmlns:xsi=\"htt p://www.w3.org/2001/XMLSchema-instance\"
EmptySizeMetric =" +
"\"0\" />";
this.treemapCon trol1.PaddingDe crementPerLevel Px = 1;
this.treemapCon trol1.PaddingPx = 5;
this.treemapCon trol1.PenWidthD ecrementPerLeve lPx = 1;
this.treemapCon trol1.PenWidthP x = 3;
this.treemapCon trol1.ShowToolT ips = true;
this.treemapCon trol1.Size = new System.Drawing. Size(656, 554);
this.treemapCon trol1.TabIndex = 0;
//
// build_button
//
this.build_butt on.Location = new System.Drawing. Point(16, 24);
this.build_butt on.Name = "build_butt on";
this.build_butt on.Size = new System.Drawing. Size(64, 24);
this.build_butt on.TabIndex = 1;
this.build_butt on.Text = "Build";
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 15);
this.ClientSize = new System.Drawing. Size(760, 614);
this.Controls.A dd(this.build_b utton);
this.Controls.A dd(this.treemap Control1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayo ut(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run (new Form1());
}
void BuildTreemap(Tr eemapControl tmcMap)
{
Nodes oNodes, oChildNodes, oGrandChildNode s;
Node oNode, oChildNode, oGrandChildNode ;
oNodes = tmcMap.Nodes;
// Add a top-level node to the collection.
oNode = oNodes.Add("Eur ope", 25F, 100F);
// Add child nodes to this node.
oChildNodes = oNode.Nodes;
oChildNode = oChildNodes.Add ("England", 50F, 2.5F);
oChildNode = oChildNodes.Add ("Ireland", 50F, -34.5F);
// Add another top-level node.
oNode = oNodes.Add("Ame ricas", 50F, -40.1F);
// Add child nodes to the this new node.
oChildNodes = oNode.Nodes;
oChildNode = oChildNodes.Add ("Canada", 20F, 200F);
oChildNode = oChildNodes.Add ("USA", 100F, 0F);
// Add a child node to one of the children
oGrandChildNode s = oChildNode.Node s;
oGrandChildNode = oGrandChildNode s.Add("Californ ia", 60F, 0F);
oGrandChildNode = oGrandChildNode s.Add("Texas", 30F, 0F);
// Draw it
//tmcMap.Draw();
}
private void build_button_Cl ick(object sender, System.EventArg s e)
{
BuildTreemap(tr eemapControl1);
}
}
}
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com