TeeChart Commander icons not shown in com .NET application

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ECDP
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Contact:

TeeChart Commander icons not shown in com .NET application

Post by ECDP » Tue Oct 24, 2006 11:11 am

Hello,

we are using an .NET application as COM-component (COM-interop registered), and call this compontent via an Visual-Basic 6 programm. In this component the TeeChart commander is used in an frame. But in the commander, the associated icons are not shown, only the white boxes for the buttons are visible. Besides it, the commander works proper, all the features of the commander can be used.

If the same component is directly called with an .NET application, the icons are schown correctly.

And the icons are internal available in the first case two, it's possible to get an item with "Commander1.ImageList.Images(1)".

So, what can be the reason, that the icons's are not shown, or is there an workaround available ?

One possible solution can be the implementation of an own tool-bar with the same icons, but I can't find an possibility to call the features of the commander directly in the programm.

Thank you in advance

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Oct 24, 2006 11:49 am

Hi ECDP,

Steema Software's recommendation is to use TeeChart Pro ActiveX with Visual Studio 6. Please notice that a free TeeChart Pro v6 ActiveX is delivered with each TeeChart for .NET v2 license. For the ActiveX license details please check your TeeChart keys or contact our Sales Dept. at sales@steema.com.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

ECDP
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by ECDP » Tue Oct 24, 2006 12:27 pm

Hi,

thank you for the answer.

But we use the Tee-Chart in an complete .NET application in .NET (not in VB6), so I think we must use the .NET version.

In the case described, we don't use the tee chart in VB6, we only call an .NET application out of an VB6 application. And this .NET application uses an .NET assembly where we use the TeeChart and the Chart commander.

The problem it, why it works different dependet on it, if the assembly is called from an VB6 application or an .NET application (and it's the same dll)?

And, to implement an work-around with an own tool-bar, I should know if it is possible to call the features of the commander directly (simulation of a button click in the commander)?

Thanks

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Oct 25, 2006 10:18 am

Hi ECDP,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

ECDP
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by ECDP » Wed Oct 25, 2006 11:05 am

Hi,

thank you for the reply.

Now I have detected that it is not a problem of the steema commander but rather a problem of the microsoft toolBar object (the same problem occures with the normal toolBar). If I remove the "Application.EnableVisualStyles()" from the .NET application, the images are shown proper. So, this problem is resolved now.

But, only for interrest, would it possible to call the functions of the commander (such as 3D, zoom, moving etc.) directly in the program (using functions of the chart etc.), for sample starting the zoom option directly with code and not by the commander-button ?

Thanks
ECDP

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Oct 25, 2006 12:09 pm

Hi ECDP,

Thanks for the information.

Yes, you can do something like this:

Code: Select all

    private Boolean RotateChart, MoveChart, ZoomChart, DChart, Go;
    private int StartX, StartY;

    private void Form1_Load(object sender, EventArgs e)
    {
      line1.FillSampleValues();

      button1.Text = "Reset";
      button2.Text = "Rotate";
      button3.Text = "Move";
      button4.Text = "Zoom";
      button5.Text = "3D%";
      button6.Text = "Editor";
    }

    private void button1_Click(object sender, EventArgs e)
    {      
      tChart1.Aspect.Orthogonal = true;
      tChart1.Aspect.HorizOffset = 0;
      tChart1.Aspect.VertOffset = 0;
      tChart1.Aspect.Zoom = 100;
      tChart1.Aspect.Chart3DPercent = 15;

      tChart1.Zoom.Allow = true;
      tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.Both;

      RotateChart = false;
      MoveChart = false;
      ZoomChart = false;
      Go = false;
    }

    private void button2_Click(object sender, EventArgs e)
    {
      RotateChart = true;
      MoveChart = false;
      ZoomChart = false;
      DChart = false;

      DisableZoomScroll();
    }

    private void button3_Click(object sender, EventArgs e)
    {
      RotateChart = false;
      MoveChart = true;
      ZoomChart = false;
      DChart = false;

      DisableZoomScroll();
    }

    private void button4_Click(object sender, EventArgs e)
    {
      RotateChart = false;
      MoveChart = false;
      ZoomChart = true;
      DChart = false;

      DisableZoomScroll();
    }

    private void button5_Click(object sender, EventArgs e)
    {
      //Changing Chart3DPercent
      RotateChart = false;
      MoveChart = false;
      ZoomChart = false;
      DChart = true;

      DisableZoomScroll();

      //Standard functionality
      //tChart1.Aspect.View3D = !tChart1.Aspect.View3D;
    }

    private void button6_Click(object sender, EventArgs e)
    {
      tChart1.ShowEditor();
    }

    private void DisableZoomScroll()
    {
      tChart1.Zoom.Allow = false;
      tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.None;
    }

    private void tChart1_MouseDown(object sender, MouseEventArgs e)
    {
      if (RotateChart || MoveChart || ZoomChart || DChart)
      {
        Go = true;
        StartX = e.X;
        StartY = e.Y;        
      }
    }

    private void tChart1_MouseMove(object sender, MouseEventArgs e)
    {
      if (Go)
      {
        if (RotateChart)
        {
          tChart1.Aspect.Orthogonal = false;
          tChart1.Aspect.Elevation = StartY - e.Y;
          tChart1.Aspect.Rotation = e.X - StartX;
        }

        if (MoveChart)
        {
          tChart1.Aspect.HorizOffset = e.X - StartX;
          tChart1.Aspect.VertOffset = e.Y - StartY;
        }

        if (ZoomChart)
        {
          tChart1.Aspect.Zoom = Math.Abs(e.X - StartX);
        }

        if (DChart)
        {
          if (((StartX - e.X) < 101) && ((StartX - e.X) > 0))
            tChart1.Aspect.Chart3DPercent = StartX - e.X;
          else
            if ((StartX - e.X) > 101)
              tChart1.Aspect.Chart3DPercent = 100;
            else
              tChart1.Aspect.Chart3DPercent = 1;          
        }        
      }      
    }

    private void tChart1_MouseUp(object sender, MouseEventArgs e)
    {
      if (RotateChart)
      {
        tChart1.Aspect.Orthogonal = false;
        tChart1.Aspect.Elevation = StartY - e.Y;
        tChart1.Aspect.Rotation = e.X - StartX;

        Go = false;
      }

      if (MoveChart)
      {
        tChart1.Aspect.HorizOffset = e.X - StartX;
        tChart1.Aspect.VertOffset = e.Y - StartY;

        Go = false;
      }

      if (ZoomChart)
      {
        tChart1.Aspect.Zoom = Math.Abs(e.X - StartX);

        Go = false;
      }

      if (DChart)
      {
        if (((StartX - e.X) < 101) && ((StartX - e.X) > 0))
          tChart1.Aspect.Chart3DPercent = StartX - e.X;
        else
          if ((StartX - e.X) > 101)
            tChart1.Aspect.Chart3DPercent = 100;
          else
            tChart1.Aspect.Chart3DPercent = 1;

        Go = false;
      }

    }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

ECDP
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by ECDP » Wed Oct 25, 2006 12:24 pm

Hi,

many thanks for this code, so if I can't find a solution to show the Icons proper (I found that it should be work using a manifest) we have the possibility to build an own tool-bar.

greetings
ECDP

Post Reply