Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C# Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kaikashu
Master Cheater
Reputation: 0

Joined: 04 Apr 2007
Posts: 251
Location: Wait Let me check...

PostPosted: Tue Aug 21, 2007 11:45 am    Post subject: C# Help Reply with quote

My project is a C# Temp converter that changes Celsuis to Fahrenheit and Vice Versa.

My only problem is.. I have the buttons show the answer in a messagebox.
I want it to show in a ReadOnly Text box. Any Ideas?

Source code Here.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double temp = int.Parse(textBox1.Text);
            double result = temp - 32.0 / 1.8;
            MessageBox.Show(result.ToString());
           
        }

        private void button2_Click(object sender, EventArgs e)
        {
            double temp = int.Parse(textBox1.Text);
            double result = temp * 1.8 - 32;
            MessageBox.Show(result.ToString());
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            foreach(char c in textBox1.Text)
            {
                 if ((int)c < 48 || (int)c > 57)
                {
                 MessageBox.Show("Invalid character");
                 textBox1.Text = "";
                    }
              }
        }
    }
}


And, I know I don't have the 2nd text box in my code yet so I'll add it when i get answers from you guys.

_________________
Back to top
View user's profile Send private message Yahoo Messenger
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Aug 21, 2007 12:03 pm    Post subject: Reply with quote

block all keys? :O
or try when its on focused then
focuse is false Very Happy
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Aug 21, 2007 1:15 pm    Post subject: Reply with quote

textboxname.Text = Convert.ToString(variable);
Back to top
View user's profile Send private message
kaikashu
Master Cheater
Reputation: 0

Joined: 04 Apr 2007
Posts: 251
Location: Wait Let me check...

PostPosted: Tue Aug 21, 2007 4:22 pm    Post subject: Reply with quote

Symbol wrote:
block all keys? :O
or try when its on focused then
focuse is false Very Happy


Hmm Yes i know how to make it read only, i just don't know how to make the answer show up in a text box

_________________
Back to top
View user's profile Send private message Yahoo Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Aug 21, 2007 4:43 pm    Post subject: Reply with quote

slovach wrote:
textboxname.Text = Convert.ToString(variable);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites