Jump to content
Software FX Community

Problem with adding ChartFX.Chart control to Tooltip instance?


Recommended Posts

I have a control container that contains many child controls including a

ChartFX.Chart. I've also added a ToolTip control to this container, so I

can easily visit each tooltip property of each control and set a text tip

which works fine for all my controls except if its a ChartFx control. I

want the tip to pop up if any portion of the Chart is moused over. Am I

missing something? I couldnt' find anything that popped up in the

documentation (hard book). It seems to require another implementation than

other controls. Thanks for any replies!

-tim

//Local Vars

private System.Windows.Forms.ToolTip toolTipInstance;

private SoftwareFX.ChartFX.Chart chartView;

private oneOfManyOtherControls;

//InitializeComponent()

this.toolTipInstance= new System.Windows.Forms.ToolTip(this.components);

this.toolTipInstance.SetToolTip(this.oneOfManyOtherControls, "Choose a

tip"); //Works

this.toolTipInstance.SetToolTip(this.chartView, "Choose another tip");

//Doesn't Work

//Add to collection

this.Controls.AddRange(new System.Windows.Forms.Control[] {this.chartView,

this.oneOfManyOtherControls});

Link to post
Share on other sites

I forgot to mention that I set the .ShowTips property to false for the

Chart, but I still didn't get the tips shown with my tip object. Thanks

for any help,

tim

"Tim Burnham" <timothy.burnham@compuware.com> wrote in message

news:h00aMORhCHA.3600@webserver1.softwarefx.com...

> I have a control container that contains many child controls including a

> ChartFX.Chart. I've also added a ToolTip control to this container, so I

> can easily visit each tooltip property of each control and set a text tip

> which works fine for all my controls except if its a ChartFx control. I

> want the tip to pop up if any portion of the Chart is moused over. Am I

> missing something? I couldnt' find anything that popped up in the

> documentation (hard book). It seems to require another implementation

than

> other controls. Thanks for any replies!

>

> -tim

>

>

>

> //Local Vars

> private System.Windows.Forms.ToolTip toolTipInstance;

>

> private SoftwareFX.ChartFX.Chart chartView;

>

> private oneOfManyOtherControls;

>

>

>

> //InitializeComponent()

>

> this.toolTipInstance= new System.Windows.Forms.ToolTip(this.components);

>

> this.toolTipInstance.SetToolTip(this.oneOfManyOtherControls, "Choose a

> tip"); //Works

>

> this.toolTipInstance.SetToolTip(this.chartView, "Choose another tip");

> //Doesn't Work

>

>

>

> //Add to collection

>

> this.Controls.AddRange(new System.Windows.Forms.Control[] {this.chartView,

> this.oneOfManyOtherControls});

>

>

>

>

>

Link to post
Share on other sites

Because the chart control is really a control container (it has other

controls inside). This approach doesn't work as it associates the tooltip to

the wrong control, the parent of all which is not the one that gets the

mouse events.

The following code allow you to assign your own tooltip to the chart:

chart1.ShowTips = false;

toolTip1 = new ToolTip();

toolTip1.SetToolTip(chart1.Controls[0],"Chart Tool Tip");

Notice that the tooltip is not attached to the chart itself but to a child

control of it.

--

FP

Software FX, Inc.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...