Monday, March 29, 2010

Tamil Poems For Wedding Invitation

C# Custom Controls: NumericTextBox

In questo post vedremo come creare una TextBox personalizzata che accetti in input solo caratteri di tipo numerico, completamente riutilizzabile.

Procediamo aggiungendo al nostro progetto una nuova classe di nome "NumericTextBox" e facendo in modo che erediti dalla classe TextBox:
  
namespace CustomControl
{
public class NumericTextBox : TextBox
{ }
}

Inseriamo una property di tipo bool che indicherà se sono permessi o meno numeri negativi:
  
public bool AllowNegative { get; set; }

Ora nel costruttore della nostra classe intercettiamo l'evento KeyPress:
  
public NumericTextBox()
{
this.KeyPress += new KeyPressEventHandler(NumericTextBox_KeyPress);
}

Infine andiamo ad implementare il metodo NumericTextBox_KeyPress, nel quale grazie alla classe NumberFormatInfo andremo a discriminare i caratteri del separatore decimale e dei segni positivo/negativo della cultura correntemente impostata:
  
void NumericTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
string decimalSeparator = NumberFormatInfo.CurrentInfo.NumberDecimalSeparator;
string negativeSign = NumberFormatInfo.CurrentInfo.NegativeSign;
string positiveSign = NumberFormatInfo.CurrentInfo.PositiveSign;

//se è un carattere di tipo controllo
if (char.IsControl(e.KeyChar))
return;
//se è il segno negativo
else if (AllowNegative && e.KeyChar.ToString() == negativeSign && ((TextBox)sender).Text == string.Empty)
return;
//se è il segno positivo
else if (e.KeyChar.ToString() == positiveSign && ((TextBox)sender).Text == string.Empty)
return;
//se è il carattere di separatore decimale e questo non è già presente
else if (e.KeyChar.ToString() == decimalSeparator && !((TextBox)sender).Text.Contains(decimalSeparator))
return;
/ / if it is a numeric character
else if (char.IsNumber (e.KeyChar))
return;
/ / in all other cases else

e.Handled = true;}


A You can now enter our NumeriTextBox in the toolbar and drag it to the form as a normal control:



Selecting NumericTextBox, the tab of the properties will be possible to exploit the property AllowNegative previously inserted to allow whether to place a negative number:

Why Do So Many Black People Have Yellow Eyes

Evento lancio Visual Studio 2010

The wait is over ... April 12, 2010 from 14:30 to 18:00 you can watch for the first time in Smooth Streaming HD , the event's launch of Visual Studio 2010 directly from your PC, and will be can interact with the speakers in real time.

Here you will find the event page where you can sign up right away, mind link to this other find the agenda of the presentation.

Friday, March 26, 2010

How Many Calories Are In A Chinese Curry

Installazione Silverlight 3 Tools per VS2008SP1: Errore aggiornamento KB967143

If installing the package Silverlight3_Tools.exe containing the Silverlight SDK and related tools for Visual Studio 2008 SP1, this is interrupted because of an error during installation of the KB967143, follow these steps:

  • Rerun the file " Silverlight3_Tools.exe "
  • The content is extracted to a folder like "C: \\ 7075dae790b40e6006"
  • Copy the entire folder to another location ;
  • Cancel the Setup program in progress;
  • Then manually install the update KB967143, SDK and Tools ( VS90SP1-KB967143-ita.msp -> silverlight_sdk.msi -> VS_SilverlightTools_Setup.exe ).

In this way the installation will fail (at least in my case) and you're ready to develop Silverlight applications with Visual Studio 2008.

Thursday, March 25, 2010

Pinnacle Tvcenter Pro 64 Bits

Finestre insolite in C#

you ever wanted to create a desktop interface with a bit 'unusual? A round window? Well, follow me in this short tutorial: start to create a new application (the screenshots are for Visual Studio 2008):
File / New / Project


select Windows Application Form .

Now we need to use an image as the background of our window in our example we choose a PNG with transparent background:


return to Visual Studio: the main form, set the BackgroundImage loading the chosen image, dimensions of the image size on the form. We leave the property BackgroundImageLayout to None (do not give in to the temptation to set it to Stretch: inhibit the transparency of the application at runtime).


Now set the FormBorderStyle to None, so we remove the title bar and the edges of the form.


Now set the property TrasparencyKey the background color of the form (or, in our case, Control):

L'ultimo passo da compiere è la gestione del trascinamento e della chiusura della nostra form: aggiungiamo alle using l'assembly InteropServices:
  
using System.Runtime.InteropServices;

...e incolliamo all'interno della classe il seguente codice:
  
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;

[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();

Infine gestiamo l'evento MouseDown, sia per il trascinamento della form col tasto sinistro del mouse, sia per chiudere l'applicazione con il tasto destro (ricordiamo che manca la barra del titolo, con i pulsanti di chiusura, riduzione e ingrandimento):
  
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
else
{
Close();
}
}

Abbiamo finito! Compiliamo ed eseguiamo l'applicazione: ecco la nostra finestra dall'aspetto insolito...

How Patient Die Glioblastoma

Le Iene - VIVIANI: Privatizzazione dell'acqua - Video Mediaset

CLICCA QUI

Wednesday, March 24, 2010

Invite Drinks On Own Bill

MEGLIU DIRI CHISSACCIU??



Tuesday, March 23, 2010

What Is Theory Of Viture (powerpoint)?

Comunicazione di servizio

Visto la frequenza scandalosamente bassa dei miei interventi sul blog, e vista la frizzante e vivace comunicatività dei giovani programmatori, da oggi questo blog ha un nuovo co-autore (che nel giro di breve potrebbe diventare l'autore principale): Welcome Diego :)

Monday, March 1, 2010

Free Trebuchet Plansfree Trebuchet Blueprints

Hai ricevuto un messaggio da Stefano Becco...

Hai ricevuto un messaggio da Stefano Becco...

Il mittente ed il messaggio che ti ha inviato saranno visibili solo a te. Per leggere cosa ti ha scritto e rispondere tramite il Messenger, segui questo link:

Leggi il tuo messaggio...



Altra gente che is waiting for you:

Roberto
Turin, Italy
Sofy
Turin, Italy
Saf
Turin, Italy

If clicking on the link, this does not work, copy it into the address bar of your browser:
http://eu1.badoo.com/0168066547/in/Vauzj3WitF8 /? lang_id = 8


This communication fa parte del sistema di notifica per il messaggio inviatoti da Stefano Becco. Se pensi che si tratti di un errore, ignora questa comunicazione.

Buon divertimento!
Il team di Badoo


Hai ricevuto questa email, in quanto un utente di Badoo ti ha lasciato un messaggio su Badoo. Eventuali risposte a questa email non sono monitorate ne risposte. Se non desideri ricevere altri messaggi da Badoo, faccelo sapere .