Solved

DatePicker Control

Posted on 2002-04-29
8
222 Views
Last Modified: 2008-03-03
Hi All,
How do i use a Date Picker control and an updowncontrol together.
Can anyone explain by a simple coding.
Thanks in advance.
0
Comment
Question by:shanth_77
8 Comments
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6979441
If you want I will send you a project.

give me your email id.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6979455
AN entire project by mail instead to show an example here?
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6979475
Do a research on MSDN Online ?

http://msdn.microsoft.com/default.asp

Cheers
0
 
LVL 3

Accepted Solution

by:
n_narayanan earned 50 total points
ID: 6979531
Try this,


VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   2610
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5490
   LinkTopic       =   "Form1"
   ScaleHeight     =   2610
   ScaleWidth      =   5490
   StartUpPosition =   3  'Windows Default
   Begin MSComCtl2.UpDown UpDown1
      Height          =   330
      Left            =   3510
      TabIndex        =   2
      Top             =   1260
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   582
      _Version        =   393216
      Enabled         =   -1  'True
   End
   Begin VB.TextBox Text1
      Height          =   285
      Left            =   2100
      TabIndex        =   0
      Top             =   1290
      Width           =   1080
   End
   Begin MSComCtl2.DTPicker DTPicker1
      Height          =   315
      Left            =   1845
      TabIndex        =   1
      Top             =   1275
      Width           =   1605
      _ExtentX        =   2831
      _ExtentY        =   556
      _Version        =   393216
      CheckBox        =   -1  'True
      Format          =   69730305
      CurrentDate     =   37376
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub DTPicker1_Change()
If Not IsNull(DTPicker1.Value) Then
    Text1.Visible = False
Else
    Text1.Visible = True
End If

End Sub

Private Sub Form_Load()
DTPicker1.Value = Null
Text1.Locked = True
End Sub

Private Sub UpDown1_DownClick()
DTPicker1.Value = DTPicker1.Value - 1
End Sub

Private Sub UpDown1_UpClick()
DTPicker1.Value = DTPicker1.Value + 1
End Sub

Narayanan
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:n_narayanan
ID: 6979536
Open a Notepad and copy the above code then save it as form1.frm

And In your Project add the components,

Microsoft Windows Common Control-2 6.0 (SP3)


Narayanan
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6979940
Why not just set the .UpDown property of the dtpicker to True and keep it simple. Why use two controls when one of them already has the required functionality?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7698665
Hi shanth_77,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept n_narayanan's comment(s) as an answer.
    *** TimCottee may have actually solved it, but barring new info, I think n_narayanan answerd the stated question.

shanth_77, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7755522
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 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

15 Experts available now in Live!

Get 1:1 Help Now