Solved

URGENT! VB.NET -- Need to get MonthCalendar value for TextBox.Text property

Posted on 2013-01-18
2
2,307 Views
Last Modified: 2013-01-19
Hello everyone,

I need to extract a date value from a MonthCalendar object and set it to the TextBox1.Text property.

Is this possible?

This is how I want to utilize the MonthCalendar:
=======================================

TextBox1.Text = MonthCalendar1._______________

I often use a DateTimePicker in these cases, but the client wants the MonthCalendar instead.
=====================================================================

TextBox1.Text = DateTimePicker1.Value.ToString("mm/DD/YYYY")


Thanks!
0
Comment
Question by:eq2006
2 Comments
 
LVL 16

Assisted Solution

by:terencino
terencino earned 250 total points
ID: 38795748
Hi what about
MonthCalendar1.SelectionStart.ToShortDateString

Open in new window

0
 
LVL 10

Accepted Solution

by:
Monica P earned 250 total points
ID: 38795937
TextBox1.Text = MonthCalendar1.SelectionStart.ToShortDateString

Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
        ' ---- Show the slected date.
      TextBox1.Text = MonthCalendar1.SelectionStart.ToShortDateString
    End Sub
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
start a process from a service 3 21
How to open form using item in Listbox. 8 20
VB.Net Tranfer data between to VB.Net apps 8 25
C# LINQ ForEach() question 6 19
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question