Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASCII to value
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
00981798
Message ID:
00981826
Vues:
51
>Have you tried the code? If TheKeyValue is 49, this code will get you a "1" in s. If it's not, then could you please post your code, cuz this should work.
>
>~~Bonnie

Yes. I've tried it. But I didn't use ToString, is that the key.
Below is my code:
	public class myconstants 
	{
		public const double pi = 3.14159265;
		public string NameOfWeek(DaysOfWeek nDay)
		{
			switch(nDay)
			{
				case DaysOfWeek.Monday:
					return "Monday";
				case DaysOfWeek.Tuesday:
					return "Tuesday";
				case DaysOfWeek.Wednesday:
					return "Wednesday";
				case DaysOfWeek.Thursday:
					return "Thursday";
				case DaysOfWeek.Friday:
					return "Friday";
				case DaysOfWeek.Saturday:
					return "Saturday";
				case DaysOfWeek.Sunday:
					return "Sunday";
			}
			return "Not a week day";
		}
	}
	public enum DaysOfWeek
	{
		Monday = 1, 
		Tuesday = 2,
		Wednesday = 3,
		Thursday = 4, 
		Friday = 5, 
		Saturday = 6, 
		Sunday = 7
	}
// In keydon
private void MainForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
  myconstants oco = new myconstants();
  MessageBox.Show(oco.NameOfWeek((DaysOfWeek)(char)e.KeyValue)); 
}
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform