725 Posted Topics

Member Avatar for khean

See if this helps. [CODE] Private Sub DataGridView1_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentDoubleClick TextBox1.Text = DataGridView1.SelectedCells(0).Value.ToString End Sub[/CODE] Btw, the code from that link is for vb6, not vb.net.

Member Avatar for khean
0
2K
Member Avatar for vn412

Loading a modal form, just like loading a MsgBox, it will stop all running code until that form is closed. Why not have your code within your modal Form and run the code right after you load this Form?

Member Avatar for grine amine
0
635
Member Avatar for Afi83

Check out [URL="http://www.daniweb.com/software-development/vbnet/threads/348154/1479109#post1479109"]this thread[/URL] about using a BackgroundWorker to run code on a separate thread. .As for updating, try [ICODE]Application.DoEvents()[/ICODE] right after setting your progress.

Member Avatar for Afi83
0
103
Member Avatar for battlex2010

Check out [URL="http://www.daniweb.com/software-development/vbnet/threads/348499/1479684#post1479684"]this thread[/URL].

Member Avatar for Unhnd_Exception
0
198
Member Avatar for ben25x

For vb6 questions, please use this forum. [URL="http://www.daniweb.com/software-development/visual-basic-4-5-6/4"]Visual Basic 4 / 5 / 6 Forum[/URL] Thanks.

Member Avatar for AndreRet
0
734
Member Avatar for markdean.expres

Even though this thread is Solved, hope this helps. Check out the first posted code from this link. [URL="http://stackoverflow.com/questions/234774/custom-button-captions-in-net-messagebox"]http://stackoverflow.com/questions/234774/custom-button-captions-in-net-messagebox[/URL] Just adding my 2 cents worth. I would personally create my own MsgBox clone from a Form since I can have total control over it. Also, use [ICODE].ShowDialog[/ICODE] instead of [ICODE].Show[/ICODE]. …

Member Avatar for codeorder
0
129
Member Avatar for tempvbacct
Member Avatar for afaque01

>>Please tell me where i'm going wrong as the message box displays 0. [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click var = TextBox1.Text Form2.Show() End Sub[/CODE] For future references [B]@Kui[/B], start you own thread for your "own" questions. Thanks.

Member Avatar for vanzhyme
0
9K
Member Avatar for markdean.expres

See if this helps to check the Clipboard data for a valid URL. [CODE] If Clipboard.ContainsData(DataFormats.Text) Then '// check if Data in Clipboard is Text. Dim sTemp As String = Clipboard.GetData(DataFormats.StringFormat).ToString '// get Data. '// check if Data .StartsWith("http://") to make sure it is a URL '--- AndAlso check if …

Member Avatar for markdean.expres
0
178
Member Avatar for jnolan19

See if this helps. [CODE]Public Class frmMain Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub ' allows the TEXT BOXES to accept only numbers, the period, and the Backspace key Private Sub txtTest1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles txtTest1.KeyPress, …

Member Avatar for codeorder
0
172
Member Avatar for vb2learn

You could use this to get a specified line from the TextBox. [CODE]TextBox2.Text = TextBox1.Lines(2) '// get line 3.[/CODE] Or you could loop through all the lines. [CODE] For Each txtLine As String In TextBox1.Lines '// loop thru all lines in TextBox. If txtLine.StartsWith("leaning daniweb.com") Then '// check if line …

Member Avatar for vb2learn
0
107
Member Avatar for xxxferraxxx

See if this helps. [CODE] Dim myFileName As String = "C:\test.exe" IO.File.WriteAllBytes(myFileName, My.Resources.testApp) If IO.File.Exists(myFileName) Then Process.Start(myFileName)[/CODE]

Member Avatar for xxxferraxxx
0
2K
Member Avatar for rookanga

See if this helps. [CODE]Public Class Form1 '// Prices for the CheckBoxes as Decimal Arrays. Private myCoolCheckBoxPrices() As Decimal = {2, 3.5, 4.35, 1.75, 5, 9.99, 0.75} '// To get the value of the 3rd Array, since Index based, you would use: myCoolCheckBoxPrices(2) Private Sub Button1_Click(ByVal sender As System.Object, ByVal …

Member Avatar for rookanga
0
952
Member Avatar for battlex2010

See if this helps. [CODE]Public Class Form1 Private myCoolConfigFile As String = "C:\test.txt" '// your File to edit. Private arTemp() As String = Nothing '// String Array to load/modify/save File lines. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If IO.File.Exists(myCoolConfigFile) Then arTemp = IO.File.ReadAllLines(myCoolConfigFile) '// …

Member Avatar for battlex2010
0
178
Member Avatar for zarifin99ska

>>then, how to put intcheckboxesChecked.tostring into a label or a textbox? Why not add it as you did in your original code, just following the For/Next loop?

Member Avatar for codeorder
0
2K
Member Avatar for Eekhoorn

See if this helps. [CODE] ComboBox1.Items.Clear() '// clear for new input. For i As Integer = 0 To 99 '// since you will get more #'s that are greater than 9, use "If Not" first. If Not i < 10 Then ComboBox1.Items.Add(i) Else ComboBox1.Items.Add("0" & i) Next[/CODE]

Member Avatar for Eekhoorn
0
140
Member Avatar for vb2learn
Member Avatar for linezero

See if this helps. [CODE]Public Class Form1 Private myFile As String = "C:\test.html" '// File for testing. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Show() '// send file lines as a Array. getLinks(IO.File.ReadAllLines(myFile)) End Sub Private Sub getLinks(ByVal htmlContentLines() As String) Dim iStartIndex, iEndIndex As …

Member Avatar for codeorder
0
251
Member Avatar for MaddTechwf

See if this helps to add a Toggle Button Control to the ToolStrip and respond as needed. [B]2 Forms, 1 ToolStrip(on Form1)[/B] [CODE]Public Class Form1 '// New CheckBox. (Appearance.Button changes a CheckBox to a Toggle Button) Public WithEvents cbNotes As New CheckBox With {.Width = 75, .Text = "Notes", .Appearance …

Member Avatar for ndeniche
0
1K
Member Avatar for arjen

See if this helps. [B]1 Button, 1 PictureBox[/B] [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click With PictureBox1 .Left += 5 .Top += 5 End With End Sub[/CODE] To change direction of movement, use [ICODE].Left -= 5[/ICODE], etc..

Member Avatar for codeorder
0
200
Member Avatar for RenanLazarotto

Check out [URL="http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/a5113a20-8c7f-4dc2-88de-a80239dfb406"]this link[/URL].

Member Avatar for RenanLazarotto
0
120
Member Avatar for MaddTechwf

Use a ListView for Columns. [CODE] With ListView1.Columns '// add Columns. .Add("Process Name", 100) : .Add("User Name", 100) : .Add("CPU", 100) : .Add("Memory", 100) : .Add("Description", 100) End With ListView1.View = View.Details '// Display Columns. '// get Processes. Dim Prc As Process() = Process.GetProcesses For x As Integer = 0 …

Member Avatar for codeorder
0
164
Member Avatar for Fattman

See if this helps to loop through the 2D Array. [CODE] Dim iMathsAverage As Integer = 0, iEnglishAverage As Integer = 0, iScienceAverage As Integer = 0 For i As Integer = 0 To StudentArray.GetLength(0) - 1 '// loop thru all Arrays. '// add values. iMathsAverage += CInt(StudentArray(i, 1)) iEnglishAverage …

Member Avatar for Fattman
0
271
Member Avatar for RenanLazarotto

See if this helps. [CODE] MsgBox(Application.StartupPath & "\files\dlls\") '// use Application.StartupPath. MsgBox(IO.File.ReadAllText(TextBox1.Text & "test.txt")) '// for testing.[/CODE] When Debugging your project, it will use the bin\Debug folder. In this case, you will need to add your 2 folders to that directory. After publishing your application and having it install, make …

Member Avatar for RenanLazarotto
0
185
Member Avatar for RenanLazarotto

If you need to get the byte count for a String, see if this helps. [CODE] Dim sTemp As String = "GetByteCount" MsgBox(System.Text.Encoding.UTF8.GetByteCount(sTemp))[/CODE] [ICODE]Note:[/ICODE] There are other types of Encoding other than UTF8.

Member Avatar for RenanLazarotto
0
143
Member Avatar for swathys

See if this helps. [CODE] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click UsernameKey("Visa") End Sub Private Sub UsernameKey(ByVal str As String) If str = "Visa" OrElse str = "Master" OrElse str = "Meps" Then MsgBox(str) End If End Sub[/CODE] Not sure why you were using …

Member Avatar for swathys
0
227
Member Avatar for lielee

See if this helps. [CODE] If Not RichTextBox1.Text = "" Then '// if Not empty, add a New line and content. RichTextBox1.Text &= vbNewLine & TextBox1.Text & " - " & TextBox2.Text Else '// if empty, just add content. RichTextBox1.Text = TextBox1.Text & " - " & TextBox2.Text End If …

Member Avatar for lielee
0
362
Member Avatar for 8mir

Probably the best solution is to use a WebBrowser, especially if you need to login to your site. [URL="http://www.daniweb.com/forums/post1438157.html#post1438157"]This[/URL] should help to extract data from WebBrowser and if you need to login to a website, [URL="http://www.daniweb.com/forums/post1328780.html#post1328780"]this[/URL] should help.

Member Avatar for codeorder
0
71
Member Avatar for Mike Askew

See if this helps. [B]2 Buttons[/B]. [CODE]Public Class Form1 Private LocationArray() As String = {"5,40,50,100", "75,125,30,45", "150,90,50,75", "75,40,180,25", "5,200,250,25"} Private penBlack As New Pen(Color.Black, 3) '// Default Color. Private penRed As New Pen(Color.Red, 3) '// Selection Color. Private arTemp() As String = Nothing '// .Split Locations Strings into(location.X, location.Y, width, …

Member Avatar for Mike Askew
0
211
Member Avatar for RenanLazarotto

See if this helps to block a key from being typed into a TextBox. [CODE] Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar = Chr(AscW("-")) Then '// check if "-" key has been pressed. '// ToolTip code here. e.Handled = True '// Cancel the …

Member Avatar for codeorder
0
176
Member Avatar for rookanga

See if this helps. [B]5 ListBoxes(items in ListBox1)[/B] [CODE]Public Class Form1 Private arlGroup1, arlGroup2, arlGroup3, arlGroup4 As New ArrayList '// 4 ArrayLists to store random items. Private lstIndexes As New List(Of Integer) '// List to add random indexes to. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles …

Member Avatar for rookanga
0
1K
Member Avatar for xreyuk

You could use a TabControl and remove the TabPages Headers. [URL="http://dotnet.mvps.org/dotnet/faqs/?id=tabcontrolremoveheaders&lang=en"]http://dotnet.mvps.org/dotnet/faqs/?id=tabcontrolremoveheaders&lang=en[/URL] Then use your btnNext/btnPrevious to scroll through the TabPages. [CODE] '// Next Tab. With TabControl1 '// if not last TabPage, go to next. If Not .SelectedIndex = .TabPages.Count - 1 Then .SelectedIndex += 1 End With[/CODE] [CODE] '// Previous …

Member Avatar for RenanLazarotto
0
411
Member Avatar for arezz09

Even though this thread is Solved, I hope the following link will help others. [URL="http://www.daniweb.com/forums/post1349728.html#post1349728"]http://www.daniweb.com/forums/post1349728.html#post1349728[/URL]

Member Avatar for arezz09
0
186
Member Avatar for anucom

>plz give d code to me "Yes Sir!" :D See if this helps to check a ListBox if it already contains an item, if not add item. [B]2 ListBoxes[/B] [CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load With ListBox1.Items '// add items for …

Member Avatar for codeorder
0
94
Member Avatar for dorothy.v

>how to put an equation statement in a label?? [CODE] Label1.Text = (2 + 2).ToString[/CODE]

Member Avatar for codeorder
0
272
Member Avatar for RenanLazarotto

Have you attempted this with the code provided in your [URL="http://www.daniweb.com/forums/post1464851.html#post1464851"]File wipe & drag-n-drop support[/URL] thread? By means of "a determined value", is that for file size or the content length in your file?

Member Avatar for RenanLazarotto
0
758
Member Avatar for Beginner.net

>...I only started today so simple techniques... I think it was more difficult to try and come up with a easy to understand solution than to put the code together.:D **1 PictureBox, 3 Buttons**(Button2 is not used, but looks good:D) Public Class Form1 Private myCoolImagesFullPaths As New ArrayList '// Store …

Member Avatar for codeorder
0
71
Member Avatar for arezz09

See if this helps with explaining a little about "SourcePath" and "DestinationPath". [CODE] If .ShowDialog = DialogResult.OK Then ' Load the specified file into a PictureBox control. PictureBox1.Image = Image.FromFile(.FileName) If IO.File.Exists(.FileName) = True Then '// check if file exists by using the FullPath of the file. IO.File.Copy(.FileName, "C:\MyPicture\" & …

Member Avatar for Jx_Man
0
1K
Member Avatar for arezz09

Also, see if this helps. [CODE] Dim myCoolColorDialog As New ColorDialog '// your Color Dialog. If myCoolColorDialog.ShowDialog = DialogResult.OK Then '// check if OK clicked. For Each ctl As Control In Me.Controls '// loop thru all controls on Form, if on another Form, use " In Form2.Controls", etc.. If TypeOf …

Member Avatar for codeorder
0
288
Member Avatar for tukky

See if this helps to change BackColor of items in a ListView. [CODE] For Each itm As ListViewItem In ListView1.Items '// loop thru all items. If itm.Text <= CStr(5) Then '// check if value is less than or equals 5. CStr = Convert to String, since using an Integer. itm.BackColor …

Member Avatar for codeorder
0
412
Member Avatar for stats79

See if this helps. [B]2 TextBoxes(MultiLine = True)[/B] [CODE]Public Class Form1 Private myCoolToonsFile As String = "C:\toons.txt" '// your File. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If IO.File.Exists(myCoolToonsFile) Then '// check if file exists. Dim arTemp() As String = IO.File.ReadAllLines(myCoolToonsFile) '// Load File in …

Member Avatar for codeorder
0
171
Member Avatar for rookanga

Use the _TextChanged event and set the value as it is being typed in. [CODE] Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged '// check if numeric, then set new value for myCustomerTotalSpendingAllowed. If IsNumeric(TextBox1.Text) Then myCustomerTotalSpendingAllowed = CDbl(TextBox1.Text) End Sub[/CODE]

Member Avatar for codeorder
0
135
Member Avatar for Joshua Kidd

See if this helps to save and load settings from a File. [B]2 CheckBoxes[/B] [CODE]Public Class Form1 Private myCoolSettingsFile As String = "C:\test.CFG" '// your settings.File. '// use Region when needing to group together portions of code. makes it easy to minimize the entire section and not one Sub at …

Member Avatar for codeorder
0
152
Member Avatar for bLuEmEzzy

See if this helps to check and compare the Date value in a MaskedTextBox. [B]1 MaskedTextBox[/B] [CODE]Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MaskedTextBox1.Mask = "00/00/0000" '// set Mask for Date Format. MaskedTextBox1.Text = "3 / 2/11" '// for testing. End Sub …

Member Avatar for codeorder
0
320
Member Avatar for steve_Student

[B]1.[/B] Give your Array a different Variable Name for each Array declared. [CODE] Dim arMyCoolTextBoxesArray() As TextBox = {TextBox1, TextBox2, TextBox3} Dim arMyOtherCoolTextBoxesArray() As TextBox = {TextBox4, TextBox5, TextBox6}[/CODE] [B]2.[/B] Use the same Array and just change the values. [CODE] Dim arMyCoolTextBoxesArray() As TextBox = {TextBox1, TextBox2, TextBox3} For i …

Member Avatar for steve_Student
0
324
Member Avatar for johnbo100

[CODE] If CType(Form1.Controls.Item("CheckBox" & texton), CheckBox).Checked = True Then MsgBox("done") End If[/CODE]

Member Avatar for johnbo100
0
421
Member Avatar for vanzhyme

See if this helps to locate and select item in ListView. [CODE] For Each itm As ListViewItem In ListView1.Items '// loop thru all items. If itm.Text = TextBox1.Text Then itm.Selected = True '// select. itm.EnsureVisible() '// make sure item is visible. Exit For '// exit loop since item located. End …

Member Avatar for vanzhyme
0
201
Member Avatar for drdream100

See if this helps. [CODE] If TextBox1.Text = Nothing OrElse TextBox2.Text = Nothing OrElse TextBox3.Text = Nothing Then MsgBox("TextBoxes CANNOT be Empty.", MsgBoxStyle.Critical) Exit Sub '// Skip the remaning code in the Sub. End If '// Save code here.[/CODE]

Member Avatar for razree
0
184
Member Avatar for arezz09

See if this helps to save and load a image, then use it as BackgroundImage of a Form. [CODE]Public Class Form1 Private myFile As String = "C:\test.txt" '// your file to save/load image path. Private myLoadedImageFile As String = "" '// used to store FullPath of image loaded. Private Sub …

Member Avatar for codeorder
0
295
Member Avatar for bettybarnes

For alphanumeric ID generator, see if this helps. [CODE] Dim myChars As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" '// Characters to use for ID. Dim myID As String = Nothing '// used to add random char. until the preset ID length. Dim idLength As Integer = 10 '// allow a 10 char. Alphanumeric …

Member Avatar for CodeWord
0
2K

The End.