Click here to Skip to main content
16,005,339 members
Home / Discussions / C#
   

C#

 
Generalwindows socket Pin
ghjhgjghjghj7-Jan-05 11:16
sussghjhgjghjghj7-Jan-05 11:16 
GeneralRe: windows socket Pin
MoustafaS8-Jan-05 1:17
MoustafaS8-Jan-05 1:17 
GeneralRe: windows socket Pin
Alex Korchemniy8-Jan-05 5:37
Alex Korchemniy8-Jan-05 5:37 
GeneralPowerPoint automation question Pin
Asad Hussain7-Jan-05 11:00
Asad Hussain7-Jan-05 11:00 
GeneralRe: PowerPoint automation question Pin
Alex Korchemniy7-Jan-05 11:12
Alex Korchemniy7-Jan-05 11:12 
Questionpressure clock ?? Pin
Sakkijha7-Jan-05 10:46
Sakkijha7-Jan-05 10:46 
AnswerRe: pressure clock ?? Pin
Alex Korchemniy7-Jan-05 11:18
Alex Korchemniy7-Jan-05 11:18 
GeneralRe: pressure clock ?? Pin
Sakkijha8-Jan-05 4:47
Sakkijha8-Jan-05 4:47 
hi thanx 4 ur help here is my code :
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace mesure
{
///
/// Summary description for Form1.

///

///

public class Form1 : System.Windows.Forms.Form
{
Graphics g ;
int x=0;
/*SolidBrush b1 = new SolidBrush(Color.Red);
Pen p1 = new Pen(b1,5);
SolidBrush b2 = new SolidBrush(Color.Green);
Pen p2 = new Pen(b2,5);
SolidBrush b3 = new SolidBrush(Color.Yellow);
Pen p3 = new Pen(b3,5);
SolidBrush b4 = new SolidBrush(Color.Black);
Pen p4 = new Pen(b4,2);*/
Rectangle rect1 = new Rectangle(15,35,100,100);
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox Green;
private System.Windows.Forms.TextBox Red;
///
/// Required designer variable.
///

///

private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.Green = new System.Windows.Forms.TextBox();
this.Red = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(96, 296);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(128, 248);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(32, 168);
this.label1.Name = "label1";
this.label1.TabIndex = 2;
this.label1.Text = "Red Value";
//
// label2
//
this.label2.Location = new System.Drawing.Point(32, 200);
this.label2.Name = "label2";
this.label2.TabIndex = 3;
this.label2.Text = "Green Value";
//
// Green
//
this.Green.Location = new System.Drawing.Point(136, 200);
this.Green.Name = "Green";
this.Green.TabIndex = 5;
this.Green.Text = "";
//
// Red
//
this.Red.Location = new System.Drawing.Point(136, 168);
this.Red.Name = "Red";
this.Red.TabIndex = 7;
this.Red.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 326);
this.Controls.Add(this.Red);
this.Controls.Add(this.Green);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.Run(new Form1());
}





private void button1_Click(object sender, System.EventArgs e)
{
double pi = 22.0 / 7.0;
double a = 50*Math.Cos(x*pi/10);
double b = 50*Math.Sin(x*pi/10);
int red = int.Parse(Red.Text.ToString());
int green = int.Parse(Green.Text.ToString());
x = int.Parse( textBox1.Text.ToString());
float x1 = 64+float.Parse(a.ToString()) ;
float y1 = 85-float.Parse(b.ToString());
g.FillPie(new SolidBrush(Color.Red),rect1,-(180-((18*red)+(18*green))),18*red);
g.FillPie(new SolidBrush(Color.Green),rect1,180,(18*green));
g.FillPie(new SolidBrush(Color.Yellow),rect1,(-18*red),-(180-((18*red)+(18*green))));
g.DrawLine(new Pen(Color.Black,2),x1,y1,64,85);
// drowPie();
}

private void Form1_Load(object sender, System.EventArgs e)
{


g = this.CreateGraphics();
drowPie();

}
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
// drowPie();
}

private void drowPie()
{


}


}
}





the problem is how to get the data from an excell sheet not from the text box's like i did.
any thing will help to update this code

help is realy need.
GeneralRe: pressure clock ?? Pin
Alex Korchemniy8-Jan-05 5:33
Alex Korchemniy8-Jan-05 5:33 
Generalservices and WaitForStatus Pin
sprout747-Jan-05 10:36
sprout747-Jan-05 10:36 
GeneralRe: services and WaitForStatus Pin
Heath Stewart7-Jan-05 11:56
protectorHeath Stewart7-Jan-05 11:56 
GeneralRe: services and WaitForStatus Pin
sprout748-Jan-05 8:50
sprout748-Jan-05 8:50 
GeneralRe: services and WaitForStatus Pin
Heath Stewart10-Jan-05 20:19
protectorHeath Stewart10-Jan-05 20:19 
QuestionHow to transfer a file from FTP server Pin
Member 8329617-Jan-05 10:16
Member 8329617-Jan-05 10:16 
AnswerRe: How to transfer a file from FTP server Pin
Heath Stewart7-Jan-05 11:49
protectorHeath Stewart7-Jan-05 11:49 
GeneralRe: How to transfer a file from FTP server Pin
Member 8329617-Jan-05 12:18
Member 8329617-Jan-05 12:18 
GeneralRe: How to transfer a file from FTP server Pin
Heath Stewart10-Jan-05 5:36
protectorHeath Stewart10-Jan-05 5:36 
GeneralModem Control Pin
alex_kl7-Jan-05 9:56
alex_kl7-Jan-05 9:56 
GeneralRe: Modem Control Pin
Heath Stewart7-Jan-05 11:45
protectorHeath Stewart7-Jan-05 11:45 
GeneralApp.Config Question... Pin
Richard Parsons7-Jan-05 8:24
Richard Parsons7-Jan-05 8:24 
GeneralRe: App.Config Question... Pin
Nick Parker7-Jan-05 8:38
protectorNick Parker7-Jan-05 8:38 
GeneralRe: App.Config Question... Pin
Richard Parsons7-Jan-05 9:12
Richard Parsons7-Jan-05 9:12 
QuestionHow can I make the datagrid invisible and have the save button come up Pin
macupryk7-Jan-05 8:10
macupryk7-Jan-05 8:10 
AnswerRe: How can I make the datagrid invisible and have the save button come up Pin
Nick Parker7-Jan-05 8:30
protectorNick Parker7-Jan-05 8:30 
GeneralBeginRead() EndRead() methods with NetworkStream class Pin
mikeyhardingboyo7-Jan-05 6:53
mikeyhardingboyo7-Jan-05 6:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.