Click here to Skip to main content
15,891,607 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to make main window invisible in VB for Windows CE? Pin
Member 989133425-Apr-13 3:50
Member 989133425-Apr-13 3:50 
GeneralRe: How to make main window invisible in VB for Windows CE? Pin
dusty_dex23-Apr-13 2:45
dusty_dex23-Apr-13 2:45 
QuestionVery long rtf string loading into RTB, and ContextSwitchDeadlock Pin
treddie22-Apr-13 13:13
treddie22-Apr-13 13:13 
AnswerRe: Very long rtf string loading into RTB, and ContextSwitchDeadlock Pin
Dave Kreskowiak22-Apr-13 14:05
mveDave Kreskowiak22-Apr-13 14:05 
GeneralRe: Very long rtf string loading into RTB, and ContextSwitchDeadlock Pin
treddie22-Apr-13 16:39
treddie22-Apr-13 16:39 
QuestionGlobal Hotkey Pin
Member 878710722-Apr-13 11:01
Member 878710722-Apr-13 11:01 
AnswerRe: Global Hotkey Pin
Dave Kreskowiak22-Apr-13 14:08
mveDave Kreskowiak22-Apr-13 14:08 
GeneralRe: Global Hotkey Pin
Member 878710723-Apr-13 6:33
Member 878710723-Apr-13 6:33 
I was trying add current date to a textbox in the current control when a user press something like Alt+D. I used an example from this Article: Setting A Global Hot Key I modified the code to something like this:

VB
Protected Overrides Sub WndProc(ByRef msg As System.Windows.Forms.Message)

        Select Case msg.Msg
            'We only care about hotkey messages
            Case ForcHotKey.WM_HOTKEY
                'if this is our hotkey and the ActiveControl from the ActiveForm is a textbox, Insert the current date.
                If CShort(msg.WParam) = m_HotkeyID Then
                    If TypeOf (Me.ActiveForm.ActiveControl) Is TextBox Then
                        Me.ActiveForm.ActiveControl.Text = Me.ActiveForm.ActiveControl.Text.Insert(Me.ActiveForm.ActiveControl.Text.Length, DateTime.Now.ToShortDateString)

                        'move the cursor to end
                        Dim tb As TextBox
                        tb = Me.ActiveForm.ActiveControl
                        tb.Select(Me.ActiveForm.ActiveControl.Text.Length, 0)
                    End If
                End If
                Exit Select
            Case Else
                'pass it back to main WndProc
                MyBase.WndProc(msg)
                Exit Select
        End Select
End Sub



All I have to do is to register the hotkey in the main MDI Form. No matter which form I'm at, while typing in the textbox whenever I press hotkey I get the current date.
GeneralRe: Global Hotkey Pin
Dave Kreskowiak23-Apr-13 7:39
mveDave Kreskowiak23-Apr-13 7:39 
QuestionHow to force a new instance when a form is created? Pin
GuyThiebaut22-Apr-13 4:26
professionalGuyThiebaut22-Apr-13 4:26 
AnswerRe: How to force a new instance when a form is created? Pin
Eddy Vluggen22-Apr-13 5:00
professionalEddy Vluggen22-Apr-13 5:00 
GeneralRe: How to force a new instance when a form is created? Pin
GuyThiebaut22-Apr-13 5:09
professionalGuyThiebaut22-Apr-13 5:09 
GeneralRe: How to force a new instance when a form is created? Pin
Eddy Vluggen22-Apr-13 7:58
professionalEddy Vluggen22-Apr-13 7:58 
GeneralRe: How to force a new instance when a form is created? Pin
GuyThiebaut22-Apr-13 8:11
professionalGuyThiebaut22-Apr-13 8:11 
GeneralRe: How to force a new instance when a form is created? Pin
Eddy Vluggen22-Apr-13 8:21
professionalEddy Vluggen22-Apr-13 8:21 
AnswerRe: How to force a new instance when a form is created? Pin
TnTinMn23-Apr-13 18:12
TnTinMn23-Apr-13 18:12 
QuestionSetup issue Pin
SPSandy20-Apr-13 2:48
SPSandy20-Apr-13 2:48 
QuestionString issue Pin
SPSandy20-Apr-13 2:42
SPSandy20-Apr-13 2:42 
AnswerRe: String issue Pin
Richard MacCutchan20-Apr-13 4:41
mveRichard MacCutchan20-Apr-13 4:41 
GeneralRe: String issue Pin
SPSandy20-Apr-13 8:24
SPSandy20-Apr-13 8:24 
GeneralRe: String issue Pin
Richard MacCutchan20-Apr-13 9:27
mveRichard MacCutchan20-Apr-13 9:27 
GeneralRe: String issue Pin
SPSandy20-Apr-13 16:21
SPSandy20-Apr-13 16:21 
AnswerRe: String issue Pin
Alan N20-Apr-13 14:16
Alan N20-Apr-13 14:16 
GeneralRe: String issue Pin
SPSandy20-Apr-13 19:58
SPSandy20-Apr-13 19:58 
QuestionStored Procedures Pin
alecxa0518-Apr-13 17:58
alecxa0518-Apr-13 17:58 

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.