Last post Apr 18, 2008 11:40 AM by Rosy1
Apr 16, 2008 10:27 AM|Rosy1|LINK
I am using a user control that will popup calendar and dispays the selected values in a text box when a button is clickes. i have written the code but the calendar is popping up on the top of the screen. How can I pop the calendar just below the button I
click. I am a beginner and any help will be appreciated. I am not sure if there is an easy way to write the code. My Code is
For the Calendar Page
For the user control page
tb = MaskedTextBox1
Apr 18, 2008 03:06 AM|Bruno Yu - MSFT|LINK
I can reproduce your project in a simple WindowsControlLibrary project. The Calendar on Form1 is shown after the button1 clicked on UserControl1. Then when there is any change on the date, the calendar will hide, the date clicked can be displayed in the
MaskedTextBox. You would like to pop the calendar "Below" the button, this is a little confused because if the calendar is "under" the UserControl, you cannot see the form and the calendar.
I suggest you to set the proper position and size of both user control and the form1 with the calendar. This can make the two UI more reasonable. Of you can also try to make the form transparent with certain percent. In my opinion, this is not the big problem
on your project.
Furthermore, there is something unprofessional in your code snippet, such as the statement "tb=MskedTextBox1", I suggest you to take a look at the example code snippet in this link below to make your code without any warning:
If there is any further question, please post the Windows Forms development questions in MSDN
Windows Forms forums. This forum is for ASP.NET Web development. There are more experts in Windows development in MSDN forums.
Hope that helps and good luck!
Apr 18, 2008 11:40 AM|Rosy1|LINK
Hi Bruno Yu,
Many thanks for the reply. I had a look into the site you recommended and it really helped.