Little Help

Posts 1–15 of 17 · Page 1 of 2
Little Help
Hi, i'm a begginer, anyways, i need some help!

What i need to do is to set a timer interval to the incoming text from a textbox.
Does someone know how to do that?

I'd appreciate your help,
Thanks,
Manuel
Learn the basics on how to use properties properly.

Timer1.Interval = Val(Textbox1.text)
I Will, thank you, but for this to work i've got to leave the timer interval value in the properties "window" empty, am I right?
Quote Originally Posted by Blubb1337 View Post

Timer1.Interval = Val(Textbox1.text)
I dont know why, it only worked when i deleted the "Val".
I'm guessing a textbox isn't the better option, i'll try a checkedlistbox with fixed values in order to keep the program from crashing and because it seems simpler and safer to the type of application i'm working on, thanks anyway!
No you don't. It will just overwrite your previously set value.
put the timer value to anything you like

then double click the tetbox
Timer1.interval = (textbox1.text)

Then double click timer
Sendkeys.send (textbox2.text)
Sendkeys.send ("{Enter}")
Quote Originally Posted by Golden. View Post
put the timer value to anything you like

then double click the tetbox
Timer1.interval = (textbox1.text)

Then double click timer
Sendkeys.send (textbox2.text)
Sendkeys.send ("{Enter}")
This may encounter errors if you have a space or any letter in the textbox. Therefore Val(Textbox1.Text) is better I guess.
Try using a numericupdown.
Quote Originally Posted by Blubb1337 View Post
Try using a numericupdown.
Ok, i'll try to use one.
Hope it works, btw, what code should i use to set the timer interval to the selected numericupdown value/number?
Quote Originally Posted by omanel View Post
Ok, i'll try to use one.
Hope it works, btw, what code should i use to set the timer interval to the selected numericupdown value/number?
Timer1.Interval = NumericUpDown1.Value
Quote Originally Posted by MugNuf View Post
Timer1.Interval = NumericUpDown1.Value
I've just remembered it while writting the code, thanks anyway

My application is almost ready, now all i've left to do is to get it to minimize in system tray and i guess it's easy, problem is solved!

Thanks to everyone who helped me once again!
If you need to use textbox or anything loosely bound, then you can check for errors:

Code:
If Microsoft.VisualBasic.IsNumeric(Textbox1.Text) Then
Timer1.Interval = Cint(Textbox1.Text.Trim)
End If
Cint converts any object to Integer.
IsNumeric function checks whether the input contains only integers.

Hope this helps !!
Quote Originally Posted by omanel View Post
I've just remembered it while writting the code, thanks anyway

My application is almost ready, now all i've left to do is to get it to minimize in system tray and i guess it's easy, problem is solved!

Thanks to everyone who helped me once again!
Minimize to tray

Form Load (Set Icon)
Code:

Code:
 Me.NotifyIcon1.Icon = Me.Icon

Form Load, Set it true

Code:

Code:
Me.NotifyIcon1.Visible = true

VB Syntax for Minimizing to System Tray

Code:

Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        NotifyIcon1.Visible = False
    End Sub
 
    Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
        Try
            Me.Show()
            Me.WindowState = FormWindowState.Normal
            NotifyIcon1.Visible = False
 
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
 
    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        Try
            If Me.WindowState = FormWindowState.Minimized Then
                Me.WindowState = FormWindowState.Minimized
                NotifyIcon1.Visible = True
                Me.Hide()
            End If
 
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

Show Balloon Tip
(use on minimize, but can be adjusted for anything

Code:
Code:
notifyIcon1.ShowBalloonTip(3000, "Your App", ("Application has not closed" & DirectCast((1
Credits: VB Snippets Vault You can always check stickies and ask for help if your stuck.
Quote Originally Posted by MJLover View Post
If you need to use textbox or anything loosely bound, then you can check for errors:

Code:
If Microsoft.VisualBasic.IsNumeric(Textbox1.Text) Then
Timer1.Interval = Cint(Textbox1.Text.Trim)
End If
Cint converts any object to Integer.
IsNumeric function checks whether the input contains only integers.

Hope this helps !!
not going to use it but thanks, i'll save the code for future programs!
Quote Originally Posted by omanel View Post
not going to use it but thanks, i'll save the code for future programs!
Yup, I know...I posted it so you can use it in future with out posting a new thread.
Posts 1–15 of 17 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us