1
Answer

For giving link for Link label

I was made window application using C# and in project i want to show recently open form on MDI form.I am use  link label to show recent open form ant it also show name of recent open  form  but after clicking on that form it can not open respective form.so i wont to open respective form by giving link how can do  it in C# .plz give me suggestion    

Answers (1)

0
Photo of Vulpes
NA 98.3k 1.5m 13y
Yes, if you know the format and you use (Try)ParseExact, then it doesn't matter about the culture:

      string s = "20110714";
      string f = "yyyyMMdd";
      DateTime dt;
      bool isValid = DateTime.TryParseExact(s, f, null, 0, out dt);
      if (isValid)
      {
         Console.WriteLine(dt);
      }
0
Photo of Jiteendra Sampathirao
NA 6.9k 1.5m 13y

hi,

use this:

string @DOB = DateTime.ParseExact(txtDOB.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat).ToString("MM/dd/yyyy");
string @DOJ = DateTime.ParseExact(txtDOJ.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat).ToString("MM/dd/yyyy");

modify this code to you requirement....