449 Posted Topics

Member Avatar for Chris147
Member Avatar for Chris147
0
1K
Member Avatar for hwlibra083

[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 & …

Member Avatar for GeekByChoiCe
0
99
Member Avatar for fairy1992224
Member Avatar for TomW
-1
75
Member Avatar for Chris11246

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]

Member Avatar for Chris11246
0
114
Member Avatar for songweaver

change [CODE]Dim years As Integer = Convert.ToInt32(cmbYears)[/CODE] to [CODE]Dim years As Integer = Convert.ToInt32(cmbYears.selecteditem)[/CODE]

Member Avatar for songweaver
0
141
Member Avatar for twalton42

[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 …

Member Avatar for Geekitygeek
0
330
Member Avatar for twalton42

you asked this question already here: [url]http://www.daniweb.com/forums/thread241370.html[/url] please describe your problem more detailed!

Member Avatar for Nick Evan
-1
92
Member Avatar for murid

[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]

Member Avatar for GeekByChoiCe
0
108
Member Avatar for khush9
Member Avatar for GeekByChoiCe
0
65
Member Avatar for Dorayaki

[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 …

Member Avatar for Dorayaki
0
263
Member Avatar for virus220

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 ;)

Member Avatar for GeekByChoiCe
0
96
Member Avatar for maliknouman

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 …

Member Avatar for maliknouman
0
256
Member Avatar for Peric

just open your other forms with .ShowDialog this prevents the user to access your StartForm until the other form is closed.

Member Avatar for Peric
0
101
Member Avatar for phatJacob07

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 …

Member Avatar for phatJacob07
0
111
Member Avatar for Damon88

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 …

Member Avatar for Damon88
0
673
Member Avatar for little marine

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 & …

Member Avatar for GeekByChoiCe
0
139
Member Avatar for pardeep3dec

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 ;)

Member Avatar for GeekByChoiCe
0
58
Member Avatar for Peric

[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?

Member Avatar for Peric
0
217
Member Avatar for vbtryer

[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]

Member Avatar for GeekByChoiCe
0
144
Member Avatar for NorthDakota

[CODE=vb] dim query as string= "SELECT Rec1, Rec2, Rec3 FROM Table1 WHERE Rec1 LIKE '%" & txtTextBox.Text & "%'" [/CODE]

Member Avatar for NorthDakota
0
184
Member Avatar for Ulukay
Member Avatar for Ulukay
0
98
Member Avatar for murid

[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]

Member Avatar for murid
0
84
Member Avatar for JonnyHawes

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

Member Avatar for JonnyHawes
0
174
Member Avatar for xVent

you can either save it in My.Settings or create a xml/text file to hole the data.

Member Avatar for GeekByChoiCe
0
143
Member Avatar for jrosh

[CODE=vb] Dim UserName As String = "myusername" Dim password As String = "mypassword" Diagnostics.Process.Start("explorer.exe", "ftp://" & UserName & ":" & password & "@microsoft.com/bugs/") [/CODE]

Member Avatar for GeekByChoiCe
0
142
Member Avatar for fulcrum9

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]

Member Avatar for kplcjl
0
153
Member Avatar for lovely ari

[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]

Member Avatar for GeekByChoiCe
0
99
Member Avatar for Kristofferson
Member Avatar for CPUTcoder

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?

Member Avatar for Vineeth K
0
137
Member Avatar for yorro

[CODE=vb]Dim StrYear As String = "1.1.2007" Dim YearStart As Date = Convert.ToDateTime(StrYear) Console.WriteLine(YearStart.Year)[/CODE]

Member Avatar for yorro
-1
185
Member Avatar for xfrolox

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]

Member Avatar for xfrolox
-1
102
Member Avatar for yorro

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 …

Member Avatar for yorro
0
2K
Member Avatar for tastybrownies

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 …

Member Avatar for tastybrownies
0
134
Member Avatar for dre-logics

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, …

Member Avatar for dre-logics
0
148
Member Avatar for Maulth

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 …

Member Avatar for samir_ibrahim
0
233
Member Avatar for Kimberley Smith
Member Avatar for babbu

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.

Member Avatar for TomW
0
392
Member Avatar for flit07

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 …

Member Avatar for flit07
0
201
Member Avatar for lil_Is

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]

Member Avatar for GeekByChoiCe
0
97
Member Avatar for A.Najafi
Member Avatar for Demon4231

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.

Member Avatar for GeekByChoiCe
0
76
Member Avatar for gedkins

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 …

Member Avatar for GeekByChoiCe
0
186
Member Avatar for mem81

[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), …

Member Avatar for mem81
0
197
Member Avatar for samehsenosi

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 = …

Member Avatar for GeekByChoiCe
0
86
Member Avatar for Merovingian

[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.

Member Avatar for sknake
0
145
Member Avatar for Merovingian

this looks like a XML file to me. so i would suggest you take a closer look into XmlDocument, XmlNodeList and so on

Member Avatar for GeekByChoiCe
0
156
Member Avatar for hemchantra

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. …

Member Avatar for GeekByChoiCe
0
2K
Member Avatar for dorkwad

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.

Member Avatar for dorkwad
0
125
Member Avatar for yorro

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 …

Member Avatar for yorro
0
469
Member Avatar for jhill1979

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 …

Member Avatar for TomW
0
116

The End.