725 Posted Topics
Re: See if this helps. [B]1 PictureBox, 2 Buttons[/B] [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click PictureBox1.Top += 5 PictureBox1.Left += 5 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click PictureBox1.Top -= 5 PictureBox1.Left -= 5 End Sub[/CODE] | |
Re: See if this helps. [CODE] Dim myPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\Text" If Not IO.Directory.Exists(myPath) Then IO.Directory.CreateDirectory(myPath) '// create if it does not exist. For Each foundFile As String In My.Computer.FileSystem.GetFiles _ (My.Computer.FileSystem.SpecialDirectories.MyDocuments, _ FileIO.SearchOption.SearchTopLevelOnly, "*.txt") My.Computer.FileSystem.MoveFile(foundFile, myPath & "/" & IO.Path.GetFileName(foundFile)) Next[/CODE] The issue was that you are … | |
Re: See if this helps to draw on a PictureBox image and save the edited image. [B]1 PictureBox, 2 Buttons, 1 ComboBox[/B] [CODE]Public Class Form1 Private myOriginalImage As String = "C:\test.png" '// Original Image File. Private myEditedImage As String = "C:\test_EDITED.png" '// Image File to Save the Edited Image. Private myGraphics … | |
Re: Check out [URL="http://www.daniweb.com/forums/post1421176.html#post1421176"]this thread[/URL] about "UserProfile". You can also use this to get a user's Desktop directory. [CODE] Dim sCoolDesktopDirectory As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) MsgBox(sCoolDesktopDirectory)[/CODE] | |
Re: Possible solution located in [URL="http://www.daniweb.com/forums/thread345727.html"]similar thread[/URL]. | |
Re: Check out [URL="http://www.daniweb.com/forums/thread324039.html"]this thread[/URL] about using SendKeys. To pause in between the SendKeys, you can use: [CODE]Threading.Thread.Sleep(1000) '// 1000 is a second.[/CODE] | |
Re: See if [URL="http://www.daniweb.com/forums/post1467540.html#post1467540"]this thread[/URL] helps for generating alphanumeric IDs, which can also be used to generate User Names and Passwords. | |
Re: [CODE]Form2.ProgressBar1.Value = Me.ProgressBar1.Value[/CODE] | |
Re: Seems that it is not your vb.net code, but your HTML. Try it with this HTML Button. [CODE=html]<input type="submit" onclick="javascript:alert('test');" value="Login" name="Login">[/CODE] I do believe that your [ICODE]onclick[/ICODE] for the button should be [ICODE]"onclick="fnbValidateLogin();"[/ICODE]. | |
Re: Use the _TextChanged Event of the TextBox. [CODE] Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged With TextBox1 '// shorten typing. If .Text = "!Help" Then '// to not make it case sensitive, use ( If .Text = "!Help".ToLower Then ). .Text = "Software by (whoever) … | |
Re: See if this helps. [CODE] For Each line As String In TextBox1.Lines '// loop thru all lines in TextBox. If Not line = "" And line.Contains("-") Then '.. check if line is not empty and it .Contains "-". With line.Split("-") '// shorten code a little by using the "With" statement. … | |
Re: See if this helps. [CODE] For Each itm As ListViewItem In ListView1.Items If itm.Checked Then MsgBox("item checked: " & itm.Text) Else MsgBox("item NOT checked: " & itm.Text) End If Next[/CODE] | |
Re: See if this helps. [CODE]Public Class Form1 Private cls As New myCoolClass '// get access to your Class. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cls.myTimer.Enabled = Not cls.myTimer.Enabled '// toggle timer on/off. End Sub End Class Public Class myCoolClass '// WithEvents, to get the … | |
Re: A bit confusing to understand. Are you trying to change the value of a String that has been already preset? | |
Re: [CODE]MRMMain.Text = cmbBoxUsers.TEXT[/CODE] | |
Re: For drag and drop, check out [URL="http://www.daniweb.com/forums/post1313057.html#post1313057"]this thread[/URL]. About "wiping" a file from the disk, do you want to just delete the file or shred the file a few times, then delete? | |
Re: As for adding a WebBrowser to the Form, check out [URL="http://www.daniweb.com/forums/post586897.html#post586897"]this thread[/URL]. | |
Re: See if this helps. [B]2 TextBoxes, 1 Label[/B] [CODE]Public Class Form1 Private iTeam1Total As Integer = 0 '// Declaration. '// Use the _TextChanged Event. Can add all TextBoxes that are for the same team, as the commented TextBox3.TextChanged. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles … | |
Re: Do you happen to have a link to the website you are trying to programatically register to? ..The link and overlooking the HTML Source code of the site should help out quite a bit with your issue. | |
Re: See if this helps. [CODE]Public Class Form1 Private myOFD As New OpenFileDialog Private Sub txt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click, TextBox2.Click, TextBox3.Click If myOFD.ShowDialog = DialogResult.OK Then CType(sender, TextBox).Text = myOFD.FileName End If End Sub End Class[/CODE] | |
Re: [B]If[/B] your Public [B]declaration [/B]is [B]on Form1[/B], then [B]call it[/B] like: [ICODE][B]Form1.MyPath[/B][/ICODE] from any other Form. Also, always set a Declaration Type when declaring something. In this case, "String" = Type. [CODE]Public MyPath As String = "C:\" [/CODE] | |
Re: See if this helps. [B]2 Buttons (Button1, Button2), 1 ProgressBar[/B] [CODE]Public Class Form1 '// Url for Paint.NET Download. ( http://www.getpaint.net/ ) Private myURL As String = "http://www.dotpdn.com/files/Paint.NET.3.5.6.Install.zip" '// File Location Saved to Desktop with the Original File Name and Extension. Private myFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & myURL.Substring(myURL.LastIndexOf("/")) '// WebClient … | |
Re: See if this helps. [CODE]Public Class Form1 Private myCoolFile As String = "C:\test.txt" '// your File. Make sure there is NO Previous "C:\test.txt" File. Private arlUrlList As New ArrayList '// ArrayList to add your Urls. Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing '// Add some … | |
Re: See if this helps. [CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate("http://google.com") End Sub Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted AddHandler WebBrowser1.Document.Click, AddressOf getClickedElement '// Add .Click Event. End Sub Private Sub getClickedElement(ByVal sender As Object, … | |
Re: Another approach. [CODE]Public Class Form1 Private myCoolClass As New testClass Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click myCoolClass.retrieveRec(Button1) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click myCoolClass.retrieveRec(Button2) End Sub End Class Public Class testClass Public Sub retrieveRec(ByVal myCoolSelectedButton As … | |
Re: See if this helps. [B]2 TextBoxes (txtUserName and txtPassword), 1 Button(Button1)[/B] [CODE]Public Class Form1 Private myCoolUserName As String = "codeorder" Private myCoolPassword As String = ".net" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Not txtUserName.Text = myCoolUserName Then '// check if User Name is … | |
Re: Since vbScript is quite similar to vb.net, I decide to give it a try. My [URL="http://notepad-plus-plus.org/"]Notepad++[/URL] is nothing like the vb.net code editor :D, but it does quite nicely. See if this helps as my first attempt at VbScript. [CODE]Select Case LCase(Answer)'// to Lower Case, not to be Case Sensitive. … | |
Re: Double click your TextBox1 and you will get the "[B]TextBox1_TextChanged[/B]" Event. This Event can also be located at the very top of the code window in the right ComboBox once your TextBox1 is selected in the left ComboBox. View attached image. Try this in a New Project with [B]1 TextBox … | |
Re: Check out [URL="http://www.daniweb.com/forums/post1387744.html#post1387744"]this link[/URL]. | |
Re: Also, check out [URL="http://www.daniweb.com/forums/post1401427.html#post1401427"]this link[/URL] for a more defined explanation to using "Command Line Arguments". | |
Re: See if this helps. [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If ComboBox1.Text = Nothing OrElse ComboBox2.Text = Nothing Then Exit Sub Label1.Text = CInt(ComboBox1.Text) + CInt(ComboBox2.Text) '// CInt = Convert to Integer, since .Text is considered a String. End Sub[/CODE] | |
Re: Why not [B]subtract the Value[/B] of your ListView2.SubItem just[B] before you remove[/B] your ListView2.Item? | |
Re: Check out your other thread. [URL="http://www.daniweb.com/forums/post1457647.html#post1457647"]http://www.daniweb.com/forums/post1457647.html#post1457647[/URL] Please do not double post. Refresh the thread if needed by replying to it. Thanks. | |
Re: Also, check out [URL="http://www.daniweb.com/forums/post1401427.html#post1401427"]this link[/URL]. | |
Re: See if this helps. [CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each ctl As Control In Me.Controls '// Loop thru all controls. If TypeOf ctl Is TextBox Then '// Locate TextBoxes. AddHandler ctl.KeyPress, AddressOf txt_KeyPress '// Associate the KeyPress Event with … | |
Re: See if this helps about drawing a border around a Label. [CODE] Dim myCoolPenstyle As New Pen(Color.Red, 2) '// (color, pen width.) With Label1 '// draw just outside the Bounds of the Label. Me.CreateGraphics.DrawRectangle(myCoolPenstyle, .Location.X - 1, .Location.Y - 1, .Width + 2, .Height + 2) End With[/CODE] | |
Re: [QUOTE=RenanLazarotto]yeH syug! woH nac I trevni ro( esrever, revetahw) a gnirts, tub gnisrever hcae drow? ekiL: sihT si a gnirts. tuptuO: This is a string. dna ton: string. a is This oslA, woh nac I od ti ot a eritne elif? sknahT ni ecnavda! [/QUOTE] teL em wonk fi siht … | |
Re: See if this helps for the TrackBar. [B]1 MenuStrip(MenuStrip1)[/B] [CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myTrackBar As New TrackBar '// Declare New TrackBar. myTrackBar.Minimum = 12 : myTrackBar.Maximum = 25 '// Customize. AddHandler myTrackBar.Scroll, AddressOf TrackBar_Scroll '// Give it a … | |
Re: [CODE] For x As Integer = 1 To CInt(UserInputTextbox.Text) For Each ctl As Control In Me.Controls '// Loop thru all Controls on Form. If TypeOf (ctl) Is Panel Then '// Locate Panels. If ctl.Name = "P" & x.ToString Then ctl.Enabled = True Exit For End If End If Next Next[/CODE] | |
Re: See if this helps. [CODE] OpenFD.Multiselect = True '// Allow Multiple File Selections. If OpenFD.ShowDialog = DialogResult.OK Then For Each selFile As String In OpenFD.FileNames MsgBox(selFile) '// Show FullPath of File. Next End If[/CODE] | |
Re: See if this helps. [CODE] Dim fontName As FontFamily = TextBox1.Font.FontFamily '// Get the Current Font Name used. TextBox1.Font = New Font(fontName, TrackBar1.Value) '// Set Font Name and Size.[/CODE] | |
Re: [CODE] '// 1 tabcontrol, 3 textboxes on tabpage 2 '// TabPages is index based, 0 = tabpage1, 1 = tabpage2, etc. MsgBox(TabControl1.TabPages(1).Controls(2).Text) '// will get the first added textbox's text . '//changing 2 to 0 will get the last control added to the tabpage.[/CODE] | |
Re: [CODE]Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Form2.TextBox1.Text = TextBox1.Text Form2.Show() End Sub End Class[/CODE] | |
Re: [CODE] Dim myCoolOpenFileDialog As New OpenFileDialog If myCoolOpenFileDialog.ShowDialog = DialogResult.OK Then '// Load File from Full Path. MsgBox(myCoolOpenFileDialog.FileName) End If[/CODE] | |
Re: See if this helps. [CODE]'//----- Pre-requisites: 3 Buttons, and a TON of CheckBoxes. ----------\\ Public Class Form1 Private arCB() As String = Nothing '// string Array to store the CheckBoxes Names and CheckStates. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Button1.Text = "save" Button2.Text = … | |
Re: See if this helps. [B]New Project, 3 PictureBoxes.[/B] [CODE]Public Class Form1 '// renamed from "PictureBox1_Click". Private Sub myCoolPictureBoxes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles PictureBox1.Click, PictureBox2.Click, PictureBox3.Click Dim pb As PictureBox = CType(sender, PictureBox) '// get Active PictureBox. myImageViewer(pb.Image) '// Call Sub and send the Active PictureBox's … | |
Re: See if this helps. [CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate("http://google.com/") End Sub Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated If WebBrowser1.Url.AbsoluteUri = "http://www.google.com/" Then WebBrowser1.Navigate(WebBrowser1.Url.AbsoluteUri & "?pass=123456") End If Me.Text = WebBrowser1.Url.AbsoluteUri End Sub End … | |
Re: Check out [URL="http://www.vbdotnetforums.com/localization-i18n-internationalization/14592-formatting-string-currency.html"]this link[/URL] about formatting to currency. Overlooking your code, I would set both, the EmplyeeType and RegularPay in the same hit. [CODE] If RadioButton1.Checked = True Then strEmployeeType = strTrainee : intRegularPay = 10 ElseIf RadioButton2.Checked = True Then strEmployeeType = strRegular : intRegularPay = 15 ElseIf RadioButton3.Checked … | |
Re: Let me know if this helps. [B]New Project, 1 WebBrowser.[/B] [CODE]Public Class Form1 Private sVisitedURL As String = "" '// keeps track of Visited webpage, to not Reload. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.ScriptErrorsSuppressed = True '// since it will throw a few … | |
Re: See if this helps. [B]New Project, 2 Forms ( 1 Button(on Form1), 1 Button (on Form2)).[/B] [CODE]Imports System.Reflection Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myAssembly As Assembly = Assembly.GetExecutingAssembly() For Each myType As Type In myAssembly.GetTypes() If myType.Name = "Form2" … |
The End.