Torna indietro   Hardware Upgrade Forum > Software > Programmazione

OVHcloud Summit 2025: le novità del cloud europeo tra sovranità, IA e quantum
OVHcloud Summit 2025: le novità del cloud europeo tra sovranità, IA e quantum
Abbiamo partecipato all'OVHcloud Summit 2025, conferenza annuale in cui l'azienda francese presenta le sue ultime novità. Abbiamo parlato di cloud pubblico e privato, d'intelligenza artificiale, di computer quantistici e di sovranità. Che forse, però, dovremmo chiamare solo "sicurezza"
Un mostro da MSI: QD-OLED WQHD a 500 Hz con AI Care e DisplayPort 2.1a
Un mostro da MSI: QD-OLED WQHD a 500 Hz con AI Care e DisplayPort 2.1a
Abbiamo potuto mettere le mani in anteprima sul nuovo monitor MSI dedicato ai giocatori: un mostro che adotta un pannello QD-OLED da 26,5 pollici con risoluzione 2560 x 1440 pixel, frequenza di aggiornamento fino a 500 Hz e tempo di risposta di 0,03 ms GtG
DJI Neo 2 in prova: il drone da 160 grammi guadagna il gimbal e molto altro
DJI Neo 2 in prova: il drone da 160 grammi guadagna il gimbal e molto altro
DJI aggiorna la sua linea di droni ultraleggeri con Neo 2, un quadricottero da 160 grammi che mantiene la compattezza del predecessore ma introduce una stabilizzazione meccanica a due assi, sensori omnidirezionali e un sistema LiDAR
Tutti gli articoli Tutte le news

Vai al Forum
Discussione Chiusa
 
Strumenti
Old 13-02-2011, 16:33   #1
dpm96
Junior Member
 
Iscritto dal: Aug 2010
Messaggi: 21
Far riconosce i tasti alla form.

Ciao,ho reato una calcolatrice tramite il compilatore visual studio 2010 e usando naturalmente .net 4.0.
Tutto ok ci ho messo tempo a risolvere certi problemi ma ci sono riuscito (tempo un giorno intero fino alle 2 di notte xd).I linguaggi che so sono il pascal,C++ e ora mi sto avicinando al c# per le form(ho 14 anni ).
Cqm... sto cercando di fare in tutti i modi ma niente keypress,keydown etc ma niente.In pratica vorrei fare che se per esempio da tastiera si preme + si deve premere e/o avere lo stesso effetto appunto del tasto + e la stessa cosa per i numeri etc.
Ecco il sorgente della form (‹‹The hÃckEr~pRo››™ sono io ):
Quote:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace WindowsFormsApplication2
{

public partial class Form1 : Form
{
public Form1()
{

InitializeComponent();
}
bool plus = false;
bool meno = false;
bool moltiplica = false;
bool dividi = false;
bool uguale = false;
bool Cradice = false;
bool Pgreco = false;

private void primo_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "1";

}

private void checkuguale()
{
if (uguale || Cradice || Pgreco)
{
textBox1.Text = "";
uguale = false;
Cradice = false;
Pgreco = false;
}

}

private void secondo_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "2";
}

private void terzo_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "3";
}

private void quarto_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "4";
}

private void quinto_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "5";
}

private void sesto_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "6";
}

private void settimo_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "7";

}

private void ottavo_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "8";
}

private void nono_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "9";

}

private void BCancella_Click(object sender, EventArgs e)
{

plus = meno = moltiplica = dividi = uguale = false;
textBox1.Text = "";
textBox1.Tag = "";
}

private void zero_Click(object sender, EventArgs e)
{
checkuguale();
textBox1.Text = textBox1.Text + "0";
}



private void radice_Click(object sender, EventArgs e)
{
Cradice = true;
textBox1.Text = Convert.ToString(System.Math.Sqrt(Convert.ToDouble(textBox1.Text)));


}

private void BPunto_Click(object sender, EventArgs e)
{
checkuguale();
if (textBox1.Text != "")
{
textBox1.Text = textBox1.Text + ",";
}
}

private void BInfo_Click(object sender, EventArgs e)
{
MessageBox.Show(" Create by ‹‹The hÃckEr~pRo››™" + "\n" + " [email protected]" + "\n" + " V 1.0");



}

private void addizione_Click(object sender, EventArgs e)
{

if (textBox1.Text == "")
{
return;
}
else
{
plus = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}

}

private void sottrazioni_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
meno = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}

private void moltiplicazioni_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
moltiplica = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}

private void divisioni_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
return;
}
else
{
dividi = true;
textBox1.Tag = textBox1.Text;
textBox1.Text = "";
}
}

private void BUguale_Click(object sender, EventArgs e)
{
uguale = true;
if (plus)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) + Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
if (meno)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) - Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
if (moltiplica)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) * Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
if (dividi)
{
decimal dec = Convert.ToDecimal(textBox1.Tag) / Convert.ToDecimal(textBox1.Text);
textBox1.Text = dec.ToString();
}
}

private void BPluesmeno_Click(object sender, EventArgs e)
{
if (textBox1.Text.Contains("-"))
{
textBox1.Text = textBox1.Text.Remove(0, 1);
}
else
{
textBox1.Text = "-" + textBox1.Text;
}
}

private void BPiGreco_Click(object sender, EventArgs e)
{
Pgreco = true;
textBox1.Text = "3,14159265358979323846";
}






}
}
dpm96 è offline  
Old 13-02-2011, 18:00   #2
s1m0_93
Bannato
 
Iscritto dal: Nov 2008
Messaggi: 136
Non ho provato, però potrebbe essere una soluzione questa

Aggiungi l'evento al delegato KeyUp del form, e all'interno del codice dell'evento fai i vari controlli per identificare il tasto premuto e svolgere le operazioni necessarie.

Codice:
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp);



private void Form1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
	//Controlli sul tasto premuto
}
Se sono stato poco chiaro dimmelo
s1m0_93 è offline  
Old 13-02-2011, 19:59   #3
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
cionci è offline  
 Discussione Chiusa


OVHcloud Summit 2025: le novità del cloud europeo tra sovranità, IA e quantum OVHcloud Summit 2025: le novità del cloud...
Un mostro da MSI: QD-OLED WQHD a 500 Hz con AI Care e DisplayPort 2.1a Un mostro da MSI: QD-OLED WQHD a 500 Hz con AI C...
DJI Neo 2 in prova: il drone da 160 grammi guadagna il gimbal e molto altro DJI Neo 2 in prova: il drone da 160 grammi guada...
L'IA "seria" di Appian è diversa: inserita nei processi e rispetta dati e persone L'IA "seria" di Appian è divers...
Polestar 3 Performance, test drive: comodità e potenza possono convivere Polestar 3 Performance, test drive: comodit&agra...
AWS Transform si evolve: agenti IA per m...
I social network hanno stancato gli ital...
Star Citizen supera i 900 milioni di dol...
Netflix ha eliminato la funzione Cast pe...
L'IA è una bolla e scoppier&agrav...
Un rapporto collega i data center di Ama...
Troppa concorrenza per Cherry (quella de...
Entro il 2035 la Cina vuole costruire de...
Tineco in super sconto: ultimo giorno di...
La Cina creerà una costellazione ...
I veicoli elettrici emettono radiazioni ...
Stai per acquistare una PS5? Attento al ...
iPhone 17 Pro Max finalmente disponibile...
Apple, Sony, Bose, Beats, Sennheiser, CM...
Arriva il Raspberry Pi 5 da 1 GB, ma por...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 05:03.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Served by www3v