Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 23rd, 2005, 02:14 PM
Registered User
 
Join Date: Jun 2005
Location: kano, kano, Nigeria.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date entry textbox as / /

I need help on how to make my textbox(i.e txtdate.text) instead to make it blank to be like / / so that I can type date string then after to convert it to date

Adamu sufi:)

  #2 (permalink)  
Old June 23rd, 2005, 04:40 PM
Friend of Wrox
 
Join Date: Jan 2004
Location: , , USA.
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you mean *masking* user input?

Are you referring to it for a web form or for windows application(visual basic application?

  #3 (permalink)  
Old June 24th, 2005, 03:54 AM
Registered User
 
Join Date: Jun 2005
Location: kano, kano, Nigeria.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am rerring to VB. NET application

  #4 (permalink)  
Old June 24th, 2005, 08:52 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Adamu,

You have 3 options. First, there are a number of 3rd party controls that will automatically do that for you. Such as Infragistics (www.infragistics.com), ComponentOne (www.componentone.com), and DevExpress (www.devexpress.com). Other than that, you will have to write your own.

Second, you can use the Masked Edit Control COM OCX that comes with .Net. It would probably do what you need it to do for dates. Just add a reference to it.

Third, if you need more functionality than the OCX provides you will have to write your own and there are some examples on the web if you search.

Hope this helps...

Scott

  #5 (permalink)  
Old June 26th, 2005, 11:05 AM
Registered User
 
Join Date: Jun 2005
Location: kano, kano, Nigeria.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi scott

I really appreciate this information
I tried exploring the sites. I will le you know about the progress.

Adamu Sufi




  #6 (permalink)  
Old February 22nd, 2009, 12:23 AM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Enter Date without Masking (VB6)

PLACE A TESTBOX & COPY & PASTE THE FOLLOWING CODE... THERE IS NO VALIDATION

Code:
Option Explicit
Private Const GWL_STYLE = (-16)
Private Const ES_NUMBER As Long = &H2000&
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" 
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" 
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Private Sub Form_Load()
'set the textbox to accept numbers only
Dim lStyle As Long
lStyle = GetWindowLong(Text1.hwnd, GWL_STYLE)
lStyle = lStyle Or ES_NUMBER
SetWindowLong Text1.hwnd, GWL_STYLE, lStyle
End Sub

Private Sub Text1_Change()
'insert slash character at appropriate position
If Len(Text1.Text) = 2 Or Len(Text1.Text) = 5 Then
Text1.SelLength = Len(Text1.Text)
Text1.SelText = "/"
End If
End Sub


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enter as a valid entry in a textbox (VB) Grimgore BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 2 February 9th, 2009 04:37 PM
TextBox entry validation thillai Visual Basic 2005 Basics 6 February 20th, 2008 07:23 AM
date entry Tim Johnson Access 1 December 26th, 2007 08:18 AM
Convert entry to non-standard date Mitch Access VBA 2 October 1st, 2007 11:43 AM
strictly for date entry only Rudner Pro VB 6 6 February 28th, 2006 09:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.