display date and time in label
-
I am trying to display the current date and time in a label. Here is my code: Dim rightNow As DateTime = DateTime.Now datetime.Text = String.Format("{0:d)", rightNow) & String.Format("{0:T)", rightNow) This code works in my other two applications but this time it underlines DateTime.Now and says Now is not a member of System.Windows.Forms.Label. Any ideas?
-
I am trying to display the current date and time in a label. Here is my code: Dim rightNow As DateTime = DateTime.Now datetime.Text = String.Format("{0:d)", rightNow) & String.Format("{0:T)", rightNow) This code works in my other two applications but this time it underlines DateTime.Now and says Now is not a member of System.Windows.Forms.Label. Any ideas?
If datetime is a label or a text, it doesn't have any property named as NOW. Now indicates the date and time for now. It is a function. :wtf: Dim myLabel as new label label.text = Now.toString
What a curious mind needs to discover knowledge is noting else than a pin-hole.
-
If datetime is a label or a text, it doesn't have any property named as NOW. Now indicates the date and time for now. It is a function. :wtf: Dim myLabel as new label label.text = Now.toString
What a curious mind needs to discover knowledge is noting else than a pin-hole.
-
I am trying to display the current date and time in a label. Here is my code: Dim rightNow As DateTime = DateTime.Now datetime.Text = String.Format("{0:d)", rightNow) & String.Format("{0:T)", rightNow) This code works in my other two applications but this time it underlines DateTime.Now and says Now is not a member of System.Windows.Forms.Label. Any ideas?