• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C#下如何用NPlot绘制期货股票K线图(3):设计要显示的股票价格图表窗口并定义相应类的成 ...

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

[内容简介]

上一篇介绍了要显示K线图所需要的数据结构,及要动态显示K线图,需要动态读取数据文件必需的几个功能函数.本篇介绍要显示蜡烛图所用到的窗口界面设计及对应类定义.下面分述如下:

[窗口界面] 见下图

 

上图中对应各周期功能按钮和标签进行相应拖放操作就是了, 不再多述 .倒是图表区为一个Nplot控件,命名:myPlot.

[窗口类定义]

  1. 界面部分自动生成的代码文件:

///<ctp1.Designer.cs>

///K线图窗口界面代码此代码由VS自动生成。

//------------------------------------------------------------------------------

 

namespace Ctp

{

partialclassFormCtpThread

{

///<summary>

/// Required designer variable.

///</summary>

private System.ComponentModel.IContainer components = null;

 

///<summary>

/// Clean up any resources being used.

///</summary>

///<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

protectedoverridevoid Dispose(bool disposing)

{

if (disposing && (components != null))

{

components.Dispose();

}

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>

privatevoid InitializeComponent()

{

this.menuStrip1 = new System.Windows.Forms.MenuStrip();

this.M5 = new System.Windows.Forms.Button();

this.myPlot = new NPlot.Windows.PlotSurface2D();

this.M1 = new System.Windows.Forms.Button();

this.M15 = new System.Windows.Forms.Button();

this.M30 = new System.Windows.Forms.Button();

this.H1 = new System.Windows.Forms.Button();

this.D1 = new System.Windows.Forms.Button();

this.W1 = new System.Windows.Forms.Button();

this.Mn1 = new System.Windows.Forms.Button();

this.label_symbol = new System.Windows.Forms.Label();

this.label1 = new System.Windows.Forms.Label();

this.textBox1 = new System.Windows.Forms.TextBox();

this.enlarge = new System.Windows.Forms.Button();

this.shrink = new System.Windows.Forms.Button();

this.labelTime = new System.Windows.Forms.Label();

this.button3 = new System.Windows.Forms.Button();

this.buttonRoll = new System.Windows.Forms.Button();

this.textBox2 = new System.Windows.Forms.TextBox();

this.buttonMove = new System.Windows.Forms.Button();

this.SuspendLayout();

//

// menuStrip1

//

this.menuStrip1.Location = new System.Drawing.Point(0, 0);

this.menuStrip1.Name = "menuStrip1";

this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;

this.menuStrip1.Size = new System.Drawing.Size(1049, 24);

this.menuStrip1.TabIndex = 1;

this.menuStrip1.Text = "menuStrip1";

//

// M5

//

this.M5.AutoSize = true;

this.M5.CausesValidation = false;

this.M5.Location = new System.Drawing.Point(337, 0);

this.M5.Name = "M5";

this.M5.Size = new System.Drawing.Size(39, 24);

this.M5.TabIndex = 2;

this.M5.TabStop = false;

this.M5.Text = "5";

this.M5.UseVisualStyleBackColor = true;

this.M5.Click += new System.EventHandler(this.M5_Click);

//

// myPlot

//

this.myPlot.AutoScaleAutoGeneratedAxes = false;

this.myPlot.AutoScaleTitle = false;

this.myPlot.BackColor = System.Drawing.Color.White;

this.myPlot.DateTimeToolTip = true;

this.myPlot.Dock = System.Windows.Forms.DockStyle.Fill;

this.myPlot.ForeColor = System.Drawing.Color.White;

this.myPlot.Legend = null;

this.myPlot.LegendZOrder = -1;

this.myPlot.Location = new System.Drawing.Point(0, 24);

this.myPlot.Name = "myPlot";

this.myPlot.RightMenu = null;

this.myPlot.ShowCoordinates = true;

this.myPlot.Size = new System.Drawing.Size(1049, 414);

this.myPlot.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;

this.myPlot.TabIndex = 1;

this.myPlot.Text = "myPlotSurface2D1";

this.myPlot.Title = "";

this.myPlot.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);

this.myPlot.XAxis1 = null;

this.myPlot.XAxis2 = null;

this.myPlot.YAxis1 = null;

this.myPlot.YAxis2 = null;

//

// M1

//

this.M1.AutoSize = true;

this.M1.CausesValidation = false;

this.M1.Location = new System.Drawing.Point(301, 0);

this.M1.Name = "M1";

this.M1.Size = new System.Drawing.Size(39, 24);

this.M1.TabIndex = 4;

this.M1.TabStop = false;

this.M1.Text = "1";

this.M1.UseVisualStyleBackColor = true;

this.M1.Click += new System.EventHandler(this.M1_Click);

//

// M15

//

this.M15.AutoSize = true;

this.M15.CausesValidation = false;

this.M15.Location = new System.Drawing.Point(373, 0);

this.M15.Name = "M15";

this.M15.Size = new System.Drawing.Size(39, 24);

this.M15.TabIndex = 6;

this.M15.TabStop = false;

this.M15.Text = "15";

this.M15.UseVisualStyleBackColor = true;

this.M15.Click += new System.EventHandler(this.M15_Click);

//

// M30

//

this.M30.AutoSize = true;

this.M30.CausesValidation = false;

this.M30.Location = new System.Drawing.Point(410, 0);

this.M30.Name = "M30";

this.M30.Size = new System.Drawing.Size(39, 24);

this.M30.TabIndex = 5;

this.M30.TabStop = false;

this.M30.Text = "30";

this.M30.UseVisualStyleBackColor = true;

this.M30.Click += new System.EventHandler(this.M30_Click);

//

// H1

//

this.H1.AutoSize = true;

this.H1.CausesValidation = false;

this.H1.Location = new System.Drawing.Point(448, 0);

this.H1.Name = "H1";

this.H1.Size = new System.Drawing.Size(39, 24);

this.H1.TabIndex = 8;

this.H1.TabStop = false;

this


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C#ref和out的区别发布时间:2022-07-13
下一篇:
C#-SendKeys方法的使用发布时间:2022-07-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap