Click here to Skip to main content
15,914,014 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: combobox last item to first item Pin
johnny196322-Apr-09 21:37
johnny196322-Apr-09 21:37 
GeneralRe: combobox last item to first item Pin
Johan Hakkesteegt22-Apr-09 21:39
Johan Hakkesteegt22-Apr-09 21:39 
GeneralRe: combobox last item to first item Pin
johnny196322-Apr-09 23:32
johnny196322-Apr-09 23:32 
AnswerRe: combobox last item to first item [modified] Pin
Alan N22-Apr-09 12:18
Alan N22-Apr-09 12:18 
GeneralRe: combobox last item to first item Pin
johnny196322-Apr-09 20:15
johnny196322-Apr-09 20:15 
GeneralRe: combobox last item to first item Pin
Alan N22-Apr-09 22:50
Alan N22-Apr-09 22:50 
GeneralRe: combobox last item to first item Pin
johnny196322-Apr-09 23:36
johnny196322-Apr-09 23:36 
QuestionMacro for retrieving word template password Pin
Jaison Peter22-Apr-09 1:05
Jaison Peter22-Apr-09 1:05 
AnswerRe: Macro for retrieving word template password Pin
Dave Kreskowiak22-Apr-09 1:54
mveDave Kreskowiak22-Apr-09 1:54 
GeneralRe: Macro for retrieving word template password Pin
Jaison Peter22-Apr-09 3:19
Jaison Peter22-Apr-09 3:19 
GeneralRe: Macro for retrieving word template password Pin
Eddy Vluggen22-Apr-09 4:11
professionalEddy Vluggen22-Apr-09 4:11 
GeneralRe: Macro for retrieving word template password Pin
Jaison Peter22-Apr-09 4:38
Jaison Peter22-Apr-09 4:38 
GeneralRe: Macro for retrieving word template password Pin
Eddy Vluggen22-Apr-09 4:52
professionalEddy Vluggen22-Apr-09 4:52 
GeneralRe: Macro for retrieving word template password Pin
Jaison Peter22-Apr-09 5:03
Jaison Peter22-Apr-09 5:03 
GeneralRe: Macro for retrieving word template password Pin
Jaison Peter22-Apr-09 5:05
Jaison Peter22-Apr-09 5:05 
GeneralRe: Macro for retrieving word template password Pin
Eddy Vluggen22-Apr-09 6:21
professionalEddy Vluggen22-Apr-09 6:21 
Questioncall a procedure in a textbox Pin
Qendro21-Apr-09 23:40
Qendro21-Apr-09 23:40 
AnswerRe: call a procedure in a textbox Pin
Henry Minute22-Apr-09 0:00
Henry Minute22-Apr-09 0:00 
GeneralRe: call a procedure in a textbox Pin
Qendro22-Apr-09 0:11
Qendro22-Apr-09 0:11 
QuestionDownload ActiveX Pin
p_196021-Apr-09 22:55
p_196021-Apr-09 22:55 
AnswerRe: Download ActiveX Pin
Christian Graus22-Apr-09 10:55
protectorChristian Graus22-Apr-09 10:55 
QuestionHow to customize date format in DTPicker created through CreateWindowEx Pin
genie1321-Apr-09 21:03
genie1321-Apr-09 21:03 
I have a DTPicker which I created through CreateWindowEx.
I want to show the date format in my DTPicker as date (space) time.
For example, "4/22/2009 13:00:00"
I used DTM_SETFORMAT but either it doesn't work, or I was doing something wrong. Confused | :confused:
There are no compile/run-time errors.
It's just that garbage characters are displayed on the DTPicker.
Hope you could help me out. Thanks in advance!

Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long

Private Declare Function GetLocaleInfo Lib "kernel32" _
   Alias "GetLocaleInfoA" _
  (ByVal Locale As Long, _
   ByVal LCType As Long, _
   ByVal lpLCData As String, _
   ByVal cchData As Long) As Long

Private mlnghwndDate As Long

Private Const LOCALE_STIMEFORMAT As Long = &H1003  'time format string
Private Const LOCALE_SSHORTDATE As Long = &H1F    'short date format string

Private Const DTM_SETFORMAT = &H1032

Private Const WS_CHILD = &H40000000
Private Const WS_VISIBLE = &H10000000


Private Sub CreateDTPicker

    ' assuming that lnghWnd_Sub and lnghInstance were previously set
    mlnghwndDate = CreateWindowEx(0, "SysDateTimePick32", vbNullString, _
    WS_CHILD + WS_VISIBLE, 0, 0, 85, 20, lnghWnd_Sub, 0, lnghInstance, Null)

    Dim lcid As Long
    
    lcid = GetSystemDefaultLCID()
    
    Dim sFormat As String
    
    Dim sTemp As String
    
    Dim bufLen As Long
    
    bufLen = 256
    
    sTemp = String(bufLen, vbNullChar)
       
    bufLen = GetLocaleInfo(lcid, LOCALE_SSHORTDATE, sTemp, bufLen)
      
    sFormat = Left(sTemp, bufLen - 1)
   
    bufLen = 256
    
    sTemp = String(bufLen, vbNullChar)
    
    bufLen = GetLocaleInfo(lcid, LOCALE_STIMEFORMAT, sTemp, bufLen)
    
    sFormat = sFormat & " " & Left(sTemp, bufLen - 1)
         
    If SendMessageSTRING(mlnghwndDate, DTM_SETFORMAT, 0, sFormat) <> 1 Then
         'Display Error Message
    End If

End Sub

AnswerRe: How to customize date format in DTPicker created through CreateWindowEx Pin
nishkarsh_k21-Apr-09 22:12
nishkarsh_k21-Apr-09 22:12 
GeneralRe: How to customize date format in DTPicker created through CreateWindowEx Pin
genie1321-Apr-09 23:33
genie1321-Apr-09 23:33 
GeneralRe: How to customize date format in DTPicker created through CreateWindowEx Pin
Johan Hakkesteegt22-Apr-09 2:59
Johan Hakkesteegt22-Apr-09 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.