800 Posted Topics
Hello my fellow Daniwebers! I am having some problems wrapping my head around the task sorting a List(Of CustomType) I have a list containing a custom class. The class contains Two DateTime objects, Start and End. I am trying to sort the list descending so that the shortest timespan will … | |
Re: I am not aware of a way to set the location of a message box, but you can create a custom dialog box to fit your needs. I have a custom dialog written in WinForms that has a multiline textbox for the data. (Acts just like a JIT messagebox) Would … | |
Re: Is this exception thrown from a client or the dev machine? If this is from the client, you need to install Crystal Reports. | |
Re: You could cheat a little and create buttons for each take picture, then hide them. Then create one more button, and on that button.click event call the: [CODE] Camera1Button.performclick Camera2Button.performclick [/CODE] ect.... They wont be EXACTLY the same time, but they will be extremely close. | |
Re: An IP with the prefix octet of 192 is always a private IP Address. You will have to assign the server a static (unchanging) ip for outside users to be able to connect. [Here](http://whatismyipaddress.com/dynamic-static) is some material for you to read/research. | |
Re: You will need a for statment to cycle through the listview. (This only works where a unique value is present for each entry.) (Like an ID Column) 'This assumes that the CODE field is unique to each database entry!! For Each li as ListViewItem In ListView1.Items With OleDa .DeleteCommand = … | |
I have a question. Does anyone know of a way to scan an image into vb.net, and then save that image as a multipage tiff? I would need a redistributable. I have been looking for a library that will do this, but every one I have found does not meet … | |
Re: Nice code snippet! Thanks, George! | |
Re: A label does not have a MaxLength Property, but it would probably be safe assumtion that it's a 32bit integer number. So a label would have 2^32 maximum characters. (4294967296 possible characters) **EDIT** [Here](http://vbcity.com/forums/t/76219.aspx) is a link that leads to an article with a custom marquee control. | |
Re: Try [CODE] SQLstr = "INSERT INTO Users (Username,Password) VALUES '" & txtUsername.text & "','" & txtPassword.Text & "'" [/CODE] | |
Re: We are not here for home work help. If you have some code of your own that you are needing help with- post it. Other than that, we are NOT going to do your homework for you. How are you going to learn when someone does it for you? | |
Re: What you could also do is: [CODE] 'Set the indexes of the controls, then use this code: 'Capture the enter key and go to next control Where i is the index of the control Me.Controls(i).Focus() [/CODE] | |
Re: Talk about bringing back dead threads... You have less or to many columns in your insert. If less on purpose, you will have to set the values to their columns. Example: Dim sqls As String = "INSERT INTO table (column1, column3, column4) VALUES ('val1','val2,'val3') | |
Re: You can try py2exe and call the exe from the vb.net application. Example: Process.Start("pathToMy.exe") | |
![]() | Re: You can try something like this: For i = 0 To ComboBox1.Items.Count - 1 e.Graphics.DrawString(ComboBox1.Items(i), PrintFont, Brushes.Black, horizontalPrintPosition, verticalPrintPosition) 'Leave some space for the next item. verticalPrintPosition += 5 Next |
Re: [Here](http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/7aa77ef3-1341-4aeb-bd6b-b1d737ae30be) is some one with a solution to this problem. | |
Re: You will want to look into [this.](http://www.connectionstrings.com/) | |
Re: Try handling it with an inline if statment: If txtUsername.Text = IIF(IsDBNull(ds.Tables("AddressBook").Rows(inc).Item(1)),"",ds.Tables("AddressBook").Rows(inc).Item(1)) Then 'Do Work End IF It is possible that you are returning a null entry from the database, thus throwing a NRE. By using this inline if, you return "" for null (not throwing a NRE) and can … | |
Re: You will have to add the dll reference to your project, import it, instantiate a variable of the form's class, and then call the forms Show() sub. | |
Re: First of all: Whoa! That formatting was terrible. Second of all: Try something like this: Dim cmd as New OleDbCommand("DBCC CHECKIDENT (YOUR_TABLE_NAME_HERE, RESEED, 0)",YOUR_CONNECTION_HERE) cmd.ExecuteNonQuery 'This will reseed the table and set the identity back to 0 | |
Re: You can do something like this: Dim di As New IO.DirectoryInfo(YourDirectoryHere) Dim diar1 As IO.FileInfo() = di.GetFiles() Dim dra As IO.FileInfo For Each dra In diar1 If dra.Extension = ".csv" Then 'Do Work End If Next | |
Re: Can you post an image of the GUI. I am having a hard time visualizing what you are doing. | |
Re: You can try something like this: Private Sub AddControls(ByVal lstControls As List(Of Control), ByVal tpgDestination As TabPage) Try If IsNothing(lstControls) = False Then For i = 0 To lstControls.Count - 1 tpgDestination.Controls.Add(lstControls(i)) Next End If Catch ex As Exception MsgBox("There was a problem adding the controls!" & vbCrLf & ex.Message … | |
Re: I think [this](http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8261&lngWId=10) is probably what you want. | |
Re: Hello! I seem to have a bit of a problem here. I deleted my old avatar ( to search for one of a better quality ) and now I can not upload the new avatar. Uppon saving the avatar, I receive the error message: "There was a problem moving the … | |
Re: Are you posting a code contribution, or requesting help? If you are requesting help, it might be wise to ask a question when you post. =) | |
Re: I have searched for a distributable for the same purpose... It came down to installing CR on the machine. | |
![]() | Re: Though a little high in cholesterol, shrimp are a great source of protein with low calories. Grilled/Steamed shrimp (3oz) can net about 85 calories with 18g of protein, but with 120mg of cholesterol. |
Re: Could also do something like this: For Each line As String in System.IO.File.RealAllLines("input.txt") Dim lstData As New List of String lstData = line.Split(vbTab).ToList For i = 0 To lstData.Count - 1 outFile.WriteLine(lstData(i)) Next Next | |
Re: Make use of the sender object of the form. You can cast the sender to the type of your control. Dim cntrl As New Type cntrl = TryCast(Sender,Type) | |
Re: Set the form's opacity color / percentage Create a label Set the back color to the opacity color Write the text in the label Set the label location to cursor location | |
Re: Try something like this in your login button's click event: With lviNew .Text = Now.ToShortDateString .SubItems.Add(Now.ToShortTimeString) End With ListView1.Items.Add(lviNew) | |
Re: Have you tried to cast it to the data type of Date? | |
Re: [Here](http://social.msdn.microsoft.com/Forums/eu/vscrystalreports/thread/2f37947e-34da-4459-b17b-c484da40d887) is an article on MSDN that has code to do exactly what you are wanting. Hope this helps | |
Re: You can split the contents of the textbox, storing them in list (of string) and remove the element, then rebuild the string. Example: Dim str As New List(Of String) 'Assuming you are using a , seperator. str = TextBox1.Text.Split(",").ToList str.Remove("test") For i = 0 To str.Count - 1 If i … | |
Re: Try something like this: For Each lviItem As ListViewItem In ListView1.Items If lviItem.Text = ComboBox1.Text Then TextBox1.Text = lviItem.SubItems(0).Text TextBox2.Text = lviItem.SubItems(1).Text End If Next | |
Re: Kind of simplistic, but you can try something like this; Private Function WeekOfYear(ByVal dt As Date) As Integer Try Return dt.DayOfYear / 7 Catch ex As Exception MsgBox("There was a problem retreiving the week of the year!" & vbCrLf & ex.Message) Return Nothing End Try End Function | |
Re: Something like this would do the trick: "INSERT INTO destinationTable(Itemname,Itemcode)" & _ "SELECT sourceTable.ItemName, sourceTable.ItemCode " & _ "FROM sourcetable WHERE sourcetable.Column=Value" | |
Re: Try something like this: Dim lviNew As New ListViewItem With lviNew 'NOTE: ' I always assign my unique values to the .Text property. ' This will make it easier to compare against a database. .Text = TextBox1.Text .SubItems.Add(ComboBox1.Text) End With | |
Re: I am not seeing a handler for the form close event, is something firing off - or is it not being handled? As for currency, try this: txtPrice.Text = CDec(txtPrice.Text).ToString("C") As for the navigation, are you scrolling, or clicking to the next entry? | |
Re: This is going to sound rude, but are you a student? If so, then you need to listen more in class. .sln A solution file. This is the project file for Visual Studio. This contains the uncompiled project and resources. When you compile and run the project, an executable is … | |
Hello! I seem to have a bit of a problem here. I deleted my old avatar ( to search for one of a better quality ) and now I can not upload the new avatar. Uppon saving the avatar, I receive the error message: "There was a problem moving the … | |
Re: txtNumRows would be the name of your textbox where you want to display the count. The (normal) naming convention for vb.net would be object type|name(camel case) So txt = TextBox Example: Dim sHello As String = "Hello, World!" 'Note the s prefix Dim iCount As Integer 'Note the i prefix … | |
Re: Don't post on 4 year old threads. Start another thread if you have a question you need to ask. | |
Re: Does your report cycle through the listview's items? If so, just execute the report on the listview's selcted items. Example: For Each itm as ListViewItem in ListView1.SelectedItems 'Do Work Next | |
Re: If the data is in a database, just execute the statement on every record. Something to the tone of: "UPDATE table SET column='OUT'" | |
Re: Use a masked text box. Just set the mask and it will do the rest for you. [Example](http://msdn.microsoft.com/en-us/library/kkx4h3az.aspx) | |
Re: After looking at your code, I do not think that you are receiving this error from this chunk of code. **Possibility** One of your substrings from the listviewitem is a string where you are trying to store Quantity. Can you please give an example of your data. OR Can you … | |
Re: If the quantity is an auto number, it will not be changeable. Other than that, just wrap your values that are strings in the correct casts or 's. Example: 'If quant is an int the listview try Cint(Me.ListView1.Items(0).SubItems(3).Text) 'Or OleDa.UpdateCommand.Parameters.Add("UPDATE [Inventry] SET [QTY] = [QTY] - '" & Me.ListView1.Items(0).SubItems(3).Text & … |
The End.