Solved

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

Posted on 2013-01-18
2
2,265 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
Comment Utility
Hi what about
MonthCalendar1.SelectionStart.ToShortDateString

Open in new window

0
 
LVL 10

Accepted Solution

by:
Monica P earned 250 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now