Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

Line Segment ActiveX Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jacky Luk - 12 Mar 2005 09:10 GMT
Does anyone know of a downloadable Line ActiveX control which allows me to
plot straight lines on a VC++.NET form?
Thanks
Jack
Derrick Coetzee [MSFT] - 14 Mar 2005 22:31 GMT
> Does anyone know of a downloadable Line ActiveX control which allows me to
> plot straight lines on a VC++.NET form?

I'm not sure exactly what you have in mind, but you should be able to draw
simple straight lines on a form using Control::CreateGraphics() and
Graphics::DrawLine() as follows:

// Warning: code untested
using System.Drawing; // Remember dependency system.drawing.dll
using System.Windows.Forms; // Remember dependency system.windows.forms.dll

void DrawFormLine(Form form, Pen pen, Point start, Point end) {
   Graphics g = form.CreateGraphics();
   g.DrawLine(pen, start, end);
}

I hope this helps - please reply if I misunderstood you or this solution
causes any trouble.
Signature

Derrick Coetzee, Microsoft Speech Server developer
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included code samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Jacky Luk - 15 Mar 2005 02:28 GMT
Yes. Though, I need to draw the lines visually at design time Thanks
Jack

"Derrick Coetzee [MSFT]" <dcoetzee@online.microsoft.com> ???g???l???s?D
:eq8U00NKFHA.4056@TK2MSFTNGP14.phx.gbl...
> > Does anyone know of a downloadable Line ActiveX control which allows me to
[quoted text clipped - 20 lines]
> Use of included code samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
Derrick Coetzee [MSFT] - 15 Mar 2005 21:51 GMT
> > > Does anyone know of a downloadable Line ActiveX control which allows me
> > > to plot straight lines on a VC++.NET form?
[quoted text clipped - 4 lines]
>
> Yes. Though, I need to draw the lines visually at design time

If it's only horizontal and vertical lines you're interested in, you might
check out this article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vxco
nchangestolinecontrolinvisualbasicnet.asp


Although it references VB.NET, the controls are the same in every .NET
language and the same trick should work:

"During upgrade, vertical or horizontal Line controls are replaced with the
Windows Forms Label control, with the Text property set to an empty string,
the BorderStyle property set to none, and the BackColor, Width, and Height
properties set to match the original control."

If you're looking instead to draw lines of arbitrary slope, unfortunately I
haven't found anything to do this, but if you're interested I could whip
something up.
Signature

Derrick Coetzee, Microsoft Speech Server developer
This posting is provided "AS IS" with no warranties, and confers no
rights.

tsda - 18 Mar 2005 20:19 GMT
Derrik:
Ironic Process (low cost)  (and graphics server.com-high cost)) have nice
Graphics server engines that can be added to a form in vc++.net via this
added toolbox plugin, and nicely complements the existing toolbox in
vc++.NET. I can't get them hooked up to read file data and update in real
time as a file changes. It's easy to load the server to a form but I'm stuck
on these real simple looking Ironic.ChartControl namespace method calls
below. Can you help/recommend? Info below. Thanks, Mike

http://www.ironic-processes.com
Chart Plotter 2004 is provided as a single Dynamic Link Library (DLL) file.  
This DLL file is a fully configured Control for .Net environments, and can be
rapidly deployed to .Net IDEs (Integrated Development Environments) and
configured using the Property Browser.  (NB alternatively, all of the
Properties defined in the Property Overview page are ‘Public’ and can be
configured in code.)

To add the DLL to your project, either add a Reference to the Solution
(Right Click on ‘References’, select ‘Add Reference..’ and browse to the
location of the ChartControl.dll file).  The Chart Plotter 2004 control can
then be accessed by referencing the Ironic.ChartControl namespace.

Alternatively, to add the Control to your Toolbox (recommended), simply
select Tools | Add/Remove Toolbox items.., and browse to the ChartControl.dll
file.  This will automatically add Chart Plotter 2004 to your Toolbox so that
it can be ‘Drawn’ live onto Forms.

Then simply add a couple of method calls to your code to plot the values,
and reset the data when you are finished.

METHOD CALLS:

Chart Plotter 2004 Public Methods



Plotting data on the Chart Plotter 2004 is extremely simple, requiring the
minimum amount of coding.  All appearance and behavioural properties are
available within the Property Browser window, enabling Chart Plotter 2004 to
be rapidly ‘Dropped’ into an application, and fully adhering to the standard
of visual design, development and Rapid Application development.



After having ‘Drawn’ Chart Plotter 2004 onto your application Form, and used
the Property Browser to set the appearance and behavioural properties, it is
necessary to add the code to actually ‘Plot’ a value onto the display.



The default Chart Plotter has one single Plot Line defined, however it is
necessary to add more Plot Lines if more than one data plot is desired. (See
PlotLineCollection in the Property Overview)



The required methods are:



Method Name
Description
Argument/s
Return Type

plotValue
Plots a value on the specified line


int LineNumber, float valueToPlot


-

plotMultipleValues
Plot an array of values – similar to plotValue except this method is
optimised to take an array of line numbers and an equal length array of
values and plot them all in one method.   This method should be used to
optimise performance when more than one plot line is used.


int lines __gc [], float values __gc []
 

resetAll
Resets all data (removes any current plots)


-
-

TimeIncrement
Increment the time value on the X-Axis (Manually.  This method is not
necessary if the IncrementTime property is set to ‘OnPlotLine1’ and plotValue
is called periodically for Plot Line 1)


-
-

setPlotLine
Manual code way to set Plot Lines (not necessary if pre-defined design time
Plot Lines are configured in the Property Browser (see the PlotLineCollection
property)


Various (7 Overloads)


____________________________________________________________________________

> > > > Does anyone know of a downloadable Line ActiveX control which allows
> me
[quoted text clipped - 23 lines]
> haven't found anything to do this, but if you're interested I could whip
> something up.
Derrick Coetzee [MSFT] - 20 Mar 2005 15:25 GMT
> Derrik:
> Ironic Process (low cost)  (and graphics server.com-high cost)) have nice
> Graphics server engines that can be added to a form in vc++.net via this
> added toolbox plugin, and nicely complements the existing toolbox in
> vc++.NET. I can't get them hooked up to read file data and update in real
> time as a file changes. It's easy to load the server to a form but I'm
stuck
> on these real simple looking Ironic.ChartControl namespace method calls
> below. Can you help/recommend? Info below. Thanks, Mike

Sorry for the slow response. I'm afraid I'm not familiar with this
company's technology and don't have access to it, but if you can describe
in more detail in what way you're stuck and what might help you make
progress, I might be able to help.
Signature

Derrick Coetzee, Microsoft Speech Server developer
This posting is provided "AS IS" with no warranties, and confers no rights.

Mike Barna - 21 Mar 2005 19:51 GMT
Derrick:
All the company provides is in my email. Cool applett but no supporting code
or samples. Do you know of a vc++ form ready for graphics that I can drop in
code to handle a file that gets updated in real time without having to write
one?
Thanks, Mike

>  > Derrik:
>  > Ironic Process (low cost)  (and graphics server.com-high cost)) have nice
[quoted text clipped - 10 lines]
> in more detail in what way you're stuck and what might help you make
> progress, I might be able to help.
Derrick Coetzee [MSFT] - 31 Mar 2005 20:19 GMT
> >  > Derrik:
> >  > Ironic Process (low cost)  (and graphics server.com-high cost)) have nice
[quoted text clipped - 15 lines]
> code to handle a file that gets updated in real time without having to write
> one?

Sorry again for the slow response. I'm not sure exactly what you're trying
to do, but if you only want to draw things based on a file's contents at
runtime, you can use either the GDI methods on Graphics, such as DrawLine(),
or use a DirectX control. If you're trying to draw a chart based on some
data in the file and update it in real-time, you should be able to use just
about any chart control to do this, such as the MSChart control. I hope this
helps.
Signature

Derrick Coetzee
This posting is provided "AS IS" with no warranties, and confers no rights.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.