449 Posted Topics
Re: add Database1DataSet.Tables("tbl_Files").AcceptChanges() at the end | |
Re: [CODE=vb] Private Sub submitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles submitButton.Click 'add selected products to CompletedOrderForm. If color1CheckBox.Checked Then Dim index As Integer = My.Forms.CompletedOrderForm.productListBox.FindString(color1CheckBox.Text) If index < 0 Then My.Forms.CompletedOrderForm.productListBox.Items.Add(color1CheckBox.Text & " " & 1) Else Dim s As String = My.Forms.CompletedOrderForm.productListBox.Items(index).ToString.Replace(color1CheckBox.Text, "").Trim My.Forms.CompletedOrderForm.productListBox.Items(index) = color1CheckBox.Text & … | |
| |
![]() | Re: you need to initialize each player as new gameobject [CODE=vb] Dim players(9) As gameobject For i As Integer = 0 To players.Length - 1 players(i) = New gameobject players(i).testProperty = CStr(i) Next For i As Integer = 0 To players.Length - 1 Console.WriteLine(players(i).testProperty) Next [/CODE] ![]() |
Re: change [CODE]Dim years As Integer = Convert.ToInt32(cmbYears)[/CODE] to [CODE]Dim years As Integer = Convert.ToInt32(cmbYears.selecteditem)[/CODE] | |
Re: [CODE=vb] Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click If CBAccountNumber.SelectedIndex = -1 Then Return 'nothing selected End If Dim result As MsgBoxResult = MsgBox("Are you sure you want to Delete Selected Account?", MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo, "Yes or No") If result = MsgBoxResult.No Then Return End … | |
Re: you asked this question already here: [url]http://www.daniweb.com/forums/thread241370.html[/url] please describe your problem more detailed! | |
Re: [CODE=vb] Try 'if the name of the picturebox is added into the listbox Dim picBox As PictureBox = CType(Me.Controls.Find(ListBox1.SelectedItem.ToString, True)(0), PictureBox) picBox.Select() Catch ex As Exception 'picturebox not found End Try [/CODE] | |
Re: [CODE=vb] frmcut.tabcontrl.SelectedTab = frmcut.TabPage1 [/CODE] | |
Re: [CODE=vb] Dim current As Date = Date.Now Dim sstatement = "SELECT TransDate, Deposit, Withdrawal, TotalAmount FROM Transactions " & _ "Where UserID = " & AccID & " and TransDate LIKE '" & current.ToShortDateString & "' " & _ "ORDER BY TransID" [/CODE] current = 11/30/2009 7:32:14 AM current.ToShortDateString= 11/30/2009 … | |
Re: if the image is the same directory as your application: [CODE] My.Application.Info.DirectoryPath & "/myImage.jpg" [/CODE] if the image is in My Documents folder [CODE]My.Computer.FileSystem.SpecialDirectories.MyDocuments & "/myImage.jpg"[/CODE] should give you an idea ;) | |
Re: can you please show us the complete code? the code you posted in your first post cant be complete. where and how you define the variable "Param"? you might keep adding parameters into param without cleaning before? so first run Param has 3 parameters, second run Param has 6 parameters … | |
![]() | Re: just open your other forms with .ShowDialog this prevents the user to access your StartForm until the other form is closed. ![]() |
Re: Level is a reserved word. change it to the query below and try again. [CODE=vb] Dim strInsert As String = "Insert Into ScoutInfo " & _ "(ScoutID, YearID, GSUSAID, FName, LName, DoB, Grade, [Level], School, YearsIn, CurrentYear) " & _ "Values (" & _ MaxID & ", " & ScoutInfoObject.YearID … | |
Re: actually solution 1 is the best solution for two reasons: 1. you are in control what games should be in list 2. the most easy way if u provide a xml file online where your game can check for new games solution 2 is bad as some geeks have 2TB … | |
Re: question is you wanna save the content of your textboxes from your different forms to the same time. if not then i would suggest to create a Module in your project and add following function: [CODE=vb] Friend Sub writeToFile(ByVal txt as String) Dim FILE_NAME As String = "C:\test2.text" My.Computer.FileSystem.WriteAllText(FILE_NAME,txt & … | |
Re: hmm i think he meant that his program shows the messagebox even there is no code for in the load event. just post your code here and see if we find it ;) | |
![]() | Re: [QUOTE]i get an error (about wrong typed date etc.)...ok, that's fine, things need to work that way. But here comes the problem, I correct the date, and then try to insert values again[/QUOTE] how about to close the connection if the exception is thrown? ![]() |
Re: [CODE=vb] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim youTube As String = "http://www.youtube.com/watch?v=KoSx4paZ7Sg&feature=response_watch" Dim tmpStr As String = youTube.Replace("http://www.youtube.com/watch?v=", "") Dim index As Integer = tmpStr.IndexOf("&") TextBox1.Text = tmpStr.Substring(0, index) End Sub [/CODE] | |
Re: [CODE=vb] dim query as string= "SELECT Rec1, Rec2, Rec3 FROM Table1 WHERE Rec1 LIKE '%" & txtTextBox.Text & "%'" [/CODE] | |
Re: instead of orderArray(x, u).Show() do: Me.Controls.Add(orderArray(x, u)) | |
Re: [CODE=vb] Private Sub DataGridView1_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting If e.RowIndex < 0 Or e.ColumnIndex < 1 Then Return End If If e.Value = "offline" Then Dim cellNew As New DataGridViewCellStyle cellNew.Font = New Font(Me.Font, FontStyle.Bold) DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Style = cellNew End If End Sub [/CODE] | |
Re: check out these train videos. [url]http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx#formsoverdata_08[/url] Beth is explaining very well how to do that | |
Re: you can either save it in My.Settings or create a xml/text file to hole the data. | |
Re: [CODE=vb] Dim UserName As String = "myusername" Dim password As String = "mypassword" Diagnostics.Process.Start("explorer.exe", "ftp://" & UserName & ":" & password & "@microsoft.com/bugs/") [/CODE] | |
Re: actually it is possible. not very sexy but possible... [CODE=vb] Private Sub box1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles box1.Click, box2.Click, box3.Click Select Case sender.Name Case "box1" 'code for box1 Case "box2" 'code for box2 Case "box3" 'code for box3 Case Else End Select End Sub[/CODE] | |
Re: [CODE=vb] Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ListBox1.SelectedIndex < 0 Then Return End If ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) End Sub [/CODE] | |
![]() | Re: do you get an error or its just not updating? |
Re: not really understandable to be honest. are the 3 users have to enter their login on the same application running on the same PC to the same time? or they are on different machines? is it working with a databse? | |
Re: [CODE=vb]Dim StrYear As String = "1.1.2007" Dim YearStart As Date = Convert.ToDateTime(StrYear) Console.WriteLine(YearStart.Year)[/CODE] | |
Re: to require admin privileges add into your app.manifest this line <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/> to check for privileges: [CODE=vb] if not My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) then msgbox "Sorry you have to be an administrator" end if[/CODE] | |
Re: lets say you have created a usercontrol named myTest then you do this in your module dim myControl as myTest myControl.myFunction functions and Subs you want to call from outside the usercontrol have to be declared as Friend not Private and the usercontrol have to be initialized already before calling … | |
Re: not sure what you mean with "pages" if its not ASP.NET but anyway you can do it on two different ways... 1. once the user logged in you can save the user name in My.Settings go to your Project properties - settings create a setting "Username" in your application save … | |
Re: 1. click on the application folder in the filesystem tab and open its properties. change the "Default location" to your needs 2. code your own updater or use the publish function of your application (but not 100% sure about that) 3. right click the Application Folder in the filesystem tab, … | |
Re: well the easiest way to find the games directories is searching in the registry. alsong you know the path of the reg key (which is same in xp, vista,7) you can get the installation path from there. for games that dont need to be installed to run you only can … | |
Re: if i have to guess i would say the problem is in this line drNewRow("Price") = txtPrice.Text.Trim if the Price is declared as money then you have to convert the txtPrice.text drNewRow("Price") = Convert.ToDouble(txtPrice.Text.Trim) but as i said...without any more details its hard to guess. | |
Re: if Form1 is still open then you can get the string just like Form1.Textbox1.text you can also create a overloaded New() procedure in Form2 to hand over the sting like [code=vb] Public Sub New (byval myString as string) TextBox2.Text=myString End Sub[/code] and call the Form2 in Form1 like Dim myForm … | |
Re: i dont know how you get the numbers so im doing just an example [code=vb] for each row as datagridviewrow in datagridview1.rows textbox1.appendtext(row.cells(0).value & ",") next [/code] | |
| |
Re: instead of looping you can use the find function like [icode]Me.Controls.Find("txtLetter1", True)(0)[/icode] this ofcourse only works if you assign a name to the control on creation and the control exist. | |
Re: if it need to return just a single value then it dont need to be declared as output. here is an example: [code=vb] Dim count As Integer Using myConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString) Dim myCommand As New SqlCommand("thenextnum", myConnection) myCommand.CommandType = CommandType.StoredProcedure myCommand.Parameters.AddWithValue("@Filter", textbox1.Text) myConnection.Open() count = myCommand.ExecuteScalar 'assign the return … | |
Re: [code=vb] Sub Main() ' text document to array Dim myarray As String() = File.ReadAllLines("C:\Original.txt") Array.Reverse(myarray) 'on this way you have the newest entry always as first Dim tmpArray As New ArrayList 'create temp array to hold the final result For Each _substring As String In myarray If Not isInArray(_substring.Substring(0, 5), … | |
Re: read the complete text into a array,clear the textbox, then loop trough this array and if not the search condition is true then append the array item to the textbox. [code=vb] dim tmpArray() as string = textbox1.text.split(vbnewline) textbox1.Text ="" for each _substring as string in tmpArray if NOT _substring = … | |
Re: [code=vb] Dim ad As New SqlDataAdapter("SELECT * FROM '" & lbListAllTables.SelectedItem.ToString & "'", SQLConn) [/code] i have to agree with TomW. it is very unsafe not to use parameter in sql queries. | |
Re: this looks like a XML file to me. so i would suggest you take a closer look into XmlDocument, XmlNodeList and so on | |
Re: if the column for your icon is set as DataGridViewImageColumn then you could do: [code=vb] For Each row As DataGridViewRow In DataGridView1.Rows if row.Cells(3).Value = "OFFLINE" then row.Cells(0).Value = My.Resources.offline else row.Cells(0).Value = My.Resources.online end if Next[/code] note: you can do the condition also at runtime instead of looping trough. … | |
Re: do you use any external dll as reference in your project? if so you need to ship them out with your applcation. i.E you set a reference to ftp.dll then you need to hand out the interop.ftp.dll which is located in your Release folder. | |
Re: hmm could be even easier. if you have functions that you need to call from different forms you can do two things: hand over the control you want to write, edit or w/e in example [code=vb] Friend sub setLabelText (byval lbl as Label) 'do some calculations here lbl.text=calculation End Sub … | |
Re: to read the details in a structure and adding to an arraylist you can use [code=vb] Dim newArr As New ArrayList Dim sr() As String = IO.File.ReadAllText("MEMBERPHONES.TXT").Split(vbNewLine) For i As Integer = 0 To sr.Length - 1 Step 2 Dim holdStruct As New phone holdStruct.name = sr(i) holdStruct.phoneNum = sr(i … |
The End.