Foros del Web » Programación para mayores de 30 ;) » .NET »

ahora si lo ultimo q les pido ya para salir

Estas en el tema de ahora si lo ultimo q les pido ya para salir en el foro de .NET en Foros del Web. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using ZedGraph; using System.IO; namespace ZedGraphTest { public partial class Form1 ...
  #1 (permalink)  
Antiguo 01/07/2010, 19:24
Avatar de sanctusbellicosus91  
Fecha de Ingreso: marzo-2010
Mensajes: 23
Antigüedad: 14 años, 1 mes
Puntos: 0
ahora si lo ultimo q les pido ya para salir

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ZedGraph;
using System.IO;

namespace ZedGraphTest
{
public partial class Form1 : Form
{
private PointPairList m_pointPairList;
//CSV Writer
private StreamWriter m_CSVWriter;

public Form1()
{
InitializeComponent();
CreateGraph();
SetSize();

//csv
zedGraphControl.ContextMenuBuilder +=
new ZedGraphControl.ContextMenuBuilderEventHandler(MyC ontextMenuBuilder);
}

private void CreateGraph()
{
GraphPane myPane = zedGraphControl.GraphPane;

// Set the titles and axis labels
myPane.Title.Text = "ZedGraph Test";
myPane.XAxis.Title.Text = "theta (angle)";
myPane.YAxis.Title.Text = "Sin (theta)";

// Make up some data points from the Sine function
m_pointPairList = new PointPairList();
for (double x = 0; x <= 360; x += 10)
{
double y = Math.Sin(x * Math.PI / 180.0);

m_pointPairList.Add(x, y);
}
// Generate a blue curve with Plus symbols,
LineItem _myCurve1 = myPane.AddCurve("Sin (theta)",
m_pointPairList, Color.Blue, SymbolType.Plus);

// Fill the pane background with a color gradient
myPane.Fill = new Fill(Color.White, Color.FromArgb(220, 220, 255), 45F);

//Make the MajorGrids of Axes visible
myPane.XAxis.MajorGrid.IsVisible = true;
myPane.YAxis.MajorGrid.IsVisible = true;

// Calculate the Axis Scale Ranges
zedGraphControl.AxisChange();
}

private void Form1_Resize(object sender, EventArgs e)
{
SetSize();
}

private void SetSize()
{
zedGraphControl.Location = new Point(10, 10);
// Leave a small margin around the outside of the control
zedGraphControl.Size = new Size(this.ClientRectangle.Width - 20,
this.ClientRectangle.Height - 20);
}

private void MyContextMenuBuilder(ZedGraphControl control,
ContextMenuStrip menuStrip, Point mousePt,
ZedGraphControl.ContextMenuObjectState objState)
{
// create a new menu item
ToolStripMenuItem _item = new ToolStripMenuItem();
// This is the user-defined Tag so you can find this menu item later if necessary
_item.Name = "Export Data as CSV";
_item.Tag = "export_data_csv";
// This is the text that will show up in the menu
_item.Text = "Export Data as CSV";
// Add a handler that will respond when that menu item is selected
_item.Click += new System.EventHandler(ShowSaveAs*****portCSV);
// Add the menu item to the menu,as 3rd Item
menuStrip.Items.Insert(2, _item);
}

private void ShowSaveAs*****portCSV(object sender, System.EventArgs e)
{
try
{
//show saveAs CmdDlg
saveFileDialog1.Filter = "CSV files (*.csv)|*.csv";
saveFileDialog1.ShowDialog();
m_CSVWriter = new StreamWriter(saveFileDialog1.FileName);
WriteCSVToStream();
m_CSVWriter.Close();
MessageBox.Show("CSV File Saved", " ZedGraph ", MessageBoxButtons.OK);
}
catch (Exception ex)
{
m_CSVWriter.Close();
MessageBox.Show(ex.ToString());
}
}

private void WriteCSVToStream()
{
//First line is for Headers., X and Y Axis
string _xAxisHeader = CheckCSVString(zedGraphControl.GraphPane.XAxis.Tit le.Text);
string _yAxisHeader = CheckCSVString(zedGraphControl.GraphPane.YAxis.Tit le.Text);
m_CSVWriter.Write(_xAxisHeader + "," + _yAxisHeader + "\n");

//subsequent lines are having data
for (int i = 0; i < m_pointPairList.Count; i++)
{
m_CSVWriter.Write(m_pointPairList[i].X + "," + m_pointPairList[i].Y + "\n");
}
}

private string CheckCSVString(string _string)
{//Check to see if there are any characters that can disturb the CSV delimeters.
string _returnString = _string;
if (_string.IndexOfAny("\",\x0A\x0D".ToCharArray()) > -1)
{
_returnString = "\"" + _string.Replace("\"", "\"\"") + "\"";
}
return _returnString;
}

}
}
__________________________________________________ ______________



es un programa en C# lo ocupo en _Vb.net por favor lo unico
  #2 (permalink)  
Antiguo 02/07/2010, 05:05
Avatar de dmassive  
Fecha de Ingreso: febrero-2002
Ubicación: Paraná - Entre Ríos - Argentina
Mensajes: 279
Antigüedad: 22 años, 2 meses
Puntos: 7
Respuesta: ahora si lo ultimo q les pido ya para salir

Hola, una buena manera de saber si los demas podran comprender tu post, es leer lo que escribiste. Eso motivara a que te lean mas rapido y te ayuden mejor.

Te dejo esta pagina de developerfusion que te pasa codigos de un lenguaje a otro (tiene C Sharp Vbnet Python Ruby):
http://www.developerfusion.com/tools.../csharp-to-vb/

Saludos!
__________________
Blümchen... einfach die rave Prinzessin
http://www.dmassive.com.ar/
  #3 (permalink)  
Antiguo 02/07/2010, 11:54
Avatar de sanctusbellicosus91  
Fecha de Ingreso: marzo-2010
Mensajes: 23
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: ahora si lo ultimo q les pido ya para salir

[QUOTE=dmassive;3465961]Hola, una buena manera de saber si los demas podran comprender tu post, es leer lo que escribiste. Eso motivara a que te lean mas rapido y te ayuden mejor.

Te dejo esta pagina de developerfusion que te pasa codigos de un lenguaje a otro (tiene C Sharp Vbnet Python Ruby):
[url]http://www.developerfusion.com/tools/convert/csharp-to-vb/[/url]

Saludos! [/QUOTE



gracias
muchas gracias

Etiquetas: salir, ultimo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:18.