4,901 Posted Topics

Member Avatar for Dani

I took a look at the winners and compared the code to the code I had submitted. I was reminded of a very old Doonesbury cartoon. **BD:** What are you writing your term paper on? **Mike:** Juxtabranchial organ secretions in the higher order mollusks. You? **BD:** Our friend the beaver. …

Member Avatar for L7Sqr
3
1K
Member Avatar for Steph333

I generally try to work from the simple case to the complex one. In this case your first concern is developing an algorithm to place the ships and you are complicating it with grids, labels, etc. I'd start with a simple 10x10 integer array. Ships (at least in the classic …

Member Avatar for Reverend Jim
0
1K
Member Avatar for Dv9UnKnoWn

The button click event should only start/stop (toggle) the timer. The timer tick handler is where you do the decrementing, testing and end-processing. If the timer interval is set to 1000 then it will "tick" once a second. The processing in the tick handler would be decrement the countdown value …

Member Avatar for Dv9UnKnoWn
0
206
Member Avatar for Doogledude123
Member Avatar for TnTinMN
0
651
Member Avatar for joshl_1995

It's possible. For sample code please see [this thread](http://www.daniweb.com/software-development/vbnet/threads/436700/using-command-inside-vb-form).

Member Avatar for Reverend Jim
0
188
Member Avatar for xcarbonx

The following code initializes a 3x3x3 array then prints out the values. Dim a(,,) As Integer = { {{101, 102, 103}, {104, 105, 106}, {107, 108, 109}}, {{201, 202, 203}, {204, 205, 206}, {207, 208, 209}}, {{301, 302, 303}, {304, 305, 306}, {307, 308, 309}}} For l As Integer = …

Member Avatar for Reverend Jim
0
241
Member Avatar for Sevyt

To calculate the new position of the label, subtract half the width of the label from half the width of the panel as in Label1.Location = New Point(Panel1.Width / 2 - Label1.Width / 2, Label1.Location.Y) By default, labels are set to autosize so if you do this calculation when the …

Member Avatar for Sevyt
0
211
Member Avatar for lebo.bytes

You could start by stating the situation up front, then asking a question with what you are having trouble with. Also, you posted almost 700 lines of code, most of which is irrelevant to the question.

Member Avatar for G_Waddell
-1
675
Member Avatar for salmaah
Member Avatar for Reverend Jim
0
165
Member Avatar for Mike Bishop

There would have to be some sort of central authority which all users could connect to. This could be a database which tracks users as they log in/log out of the app, or it could be as simple as a shared folder in which a file is created/deleted at app …

Member Avatar for Reverend Jim
0
95
Member Avatar for e_user

The following code will extract all lines in a file containing a given string. If Ubound(lines) is -1 then the string wasn't found. Dim file As String = "D:\temp\swap.txt" Dim text As String = "Aaaaa" Dim lines() As String = Filter(System.IO.File.ReadAllLines(file), text)

Member Avatar for Reverend Jim
0
4K
Member Avatar for Stealthbird97

You can generate a color from numeric values by Color.FromArgb(255, 100, 100, 255) where the parameters are transparancy, r, g, and b.

Member Avatar for Reverend Jim
0
101
Member Avatar for johnrockscurbi
Member Avatar for Reverend Jim
0
71
Member Avatar for Hazuan Nazri

Depending on what the underlying database is, there are functions which wull replace DBNULL with a valid value. For example, in MS SQL you can use the COALESCE function as follows SELECT lname, fname, COALESCE(mname,"(none)") FROM myTable This will return values for all three fields, even when there is no …

Member Avatar for G_Waddell
0
1K
Member Avatar for gelmi

Try explicitly naming the fields in the insert as in INSERT INTO myTable (lname,fname) VALUES('Bunker','Archie')

Member Avatar for G_Waddell
0
114
Member Avatar for renzlo

You can use the Year property of a date to get the year number and compare it to the current year.

Member Avatar for Reverend Jim
0
222
Member Avatar for xcarbonx

You could try For Each line As String In System.IO.File.ReadAllLines("d:\temp\test.txt") Dim col() As String = {"", "", "", "", ""} Dim fld() As String = line.Split(vbTab) For i As Integer = 0 To UBound(fld) col(i) = fld(i) Next For i As Integer = 0 To UBound(col) Debug.WriteLine(" field " & …

Member Avatar for xcarbonx
0
331
Member Avatar for gurupts

1. already answered 1. don't hijack threads (especially old ones) 1. your question is too vague

Member Avatar for Reverend Jim
0
753
Member Avatar for shoebodh

Is that a specific example of a more general case?. For example, if the last three fields are always -1,-1,-1 then you just need to replace ",-1,-1,-1)" with ")". However, if the last three fields can take on other values then one solution would be a loop that would look …

Member Avatar for Reverend Jim
0
31K
Member Avatar for jhedonghae

By the way Dim lviNew As New ListViewItem With lviNew .Text = EmpNumTextBox.Text .SubItems.Add(dates.Text) .SubItems.Add(timein.Text) End With TimeSheetListView.Items.Add(lviNew) can be written as TimeSheetListView.Items.Add(New ListViewItem({EmpNumTextBox.Text,dates.Text,timein.Text}))

Member Avatar for jhedonghae
0
194
Member Avatar for np complete

I have to agree with pritaeas. Hackers was a movie I could watch over and over. Stellar cast, just the right touch of humour, and a cameo by James Earl Jones.

Member Avatar for BigPaw
1
726
Member Avatar for jlego
Member Avatar for Jwthais

This thread is a year old. Chances are the OP doesn't need the info anymore.

Member Avatar for Reverend Jim
0
103
Member Avatar for Reverend Jim

When I click on "Files" to attach a file to a post, I get part of the upload area with the text >Upload Attachments Files will automatically be attached to the post upon upload. Optionally, you can embed uploaded images within your post. but there are no Browse buttons or …

Member Avatar for Ancient Dragon
0
68
Member Avatar for lkallas

Maybe not as simple as you'd like but what I'd do is **Inventory** * ProductID (PK) * ProductCode * SerialNumber * Cost * ProductName * Description **Customer** * CustomerID (PK) * CustomerName * CustomerAddress **Orders** * OrderID (PK) * CustomerID (FK) * OrderDate * Tax * TotalCost **OrderItems** * OrderID …

Member Avatar for Reverend Jim
0
179
Member Avatar for Reverend Jim

With the permission of IBM, the Computer History Museum is pleased to make available the source code to the 1969-1972 “XM6” version of APL for the System/360 for non-commercial use. The source code can be downloaded [here](http://www.computerhistory.org/atchm/the-apl-programming-language-source-code/). The article also documents the history and development of this unique and powerful …

0
79
Member Avatar for np complete

I'm still waiting for the movie. There has been talk about it for years.

Member Avatar for np complete
0
94
Member Avatar for king03

Before I retired I developed a process inventory system. We had hundreds of processes that were interconnected and trying to troubleshoot the system when there was a breakdown was a nightmare. My boss (an electrical engineer) preferred multi-page flowcharts that looked like circuit diagrams with lots of off-page connectors (a …

Member Avatar for BigPaw
0
204
Member Avatar for ohwhatacuteanaconda

Look at it as an array problem. Your array contains the various denominations in cents. Your possible change values are dollars (100), quarters (25), etc. so your array is Dim denom() As Integer = {100, 25, 10, 5, 1} Then you calculate the difference between what is owed and what …

Member Avatar for Reverend Jim
0
110
Member Avatar for lkallas

Private Sub DateTimePicker1_ValueChanged(sender As System.Object, e As System.EventArgs) Handles DateTimePicker1.ValueChanged If ComboBox1.SelectedIndex >= 0 Then Dim dt As DateTimePicker = sender MsgBox(dt.Value) MsgBox(DateAdd(DateInterval.Year, CInt(ComboBox1.Text), dt.Value)) End If End Sub

Member Avatar for Reverend Jim
0
126
Member Avatar for jontennyeah
Member Avatar for NYCRAVEN

Dim hr As Integer = CInt(textboxAm.Text) Dim msg As String = "" Select Case Lcase(ComboBox1.Text) Case "monday" If hr < 8 Or hr > 12 Then msg = "monday min is 8 and max is 12" End If Case "friday" If hr < 12 Or hr > 24 Then msg …

Member Avatar for NYCRAVEN
0
4K
Member Avatar for cheekangteh

You might want to check out the FileSystemWatcher control. I think it is better to let the system notify you of changes than to continuously poll the system. Wrox Press Visual Basic 2008 Programmer's Reference says: The FileSystemWatcher class keeps an eye on part of the file system and raises …

Member Avatar for lebo.bytes
0
1K
Member Avatar for syedamuhibzahra

@mike - I imagine that you will be getting lots of blowback for your views on addiction (which I happen to share). I think that there are certain substances, such as nicotine, that can produce powerful cravings when intake is stopped. The cigarette companies used that fact for years to …

Member Avatar for stultuske
0
263
Member Avatar for jontennyeah

There are several tutorials available from within the IDE or directly at msdn. One set of tutorials is available [here](http://msdn.microsoft.com/en-us/bb188199.aspx)

Member Avatar for Reverend Jim
0
108
Member Avatar for Reverend Jim

I'd like to suggest a small change to the way "Replies" are handles in the PM section. I like that when I reply to a PM, the subject line gets changed from "Original Title" to "Re: Original Title", but when there are several back-and-forths on the same topic, the title …

Member Avatar for debasisdas
2
123
Member Avatar for sean.downes.96

I assume you have a line of code somewhere to add the new row to the ListView similar to ListView1.Items.Add(item) Why can't you add a line after that like TextBox1.Text = "# of rows is " & ListView1.Items.Count.ToString()

Member Avatar for Begginnerdev
0
122
Member Avatar for sean.downes.96

Judging from your other posts you know very little about Visual Basic. You didn't know what a textbox was even after it was clearly explained and now you have shown that you don't even know the proper syntax of an IF statement. Read a book or two on Visual Basic. …

Member Avatar for pritaeas
-1
135
Member Avatar for veeeeebeeeee
Member Avatar for vinaylucky2

If you put the RadioButtons in a container like a GroupBox you can do For Each rb As RadioButton In GroupBox1.Controls.OfType(Of RadioButton)() Debug.WriteLine(rb.Name & " " & rb.Checked) Next

Member Avatar for adam_k
0
122
Member Avatar for killerSmile

We won't do your homework for you. You have to show some effort first. We can help with specific suggestions but you will have to do the majority of the work yourself.

Member Avatar for killerSmile
0
2K
Member Avatar for Sevyt

When you say >For example >Streetname / house number / box number You are not actually giving an example. Do you actually mean that the format is like Main Street/1234/57 Without knowing what formats are valid I can't show you how to parse it. Typical addresses might be 5B-1017 Cornet …

Member Avatar for Sevyt
0
174
Member Avatar for IS_student

It is possible you are deleting records in the dataset (an in-memory copy of the table) but not the underlying database table. You haven't shown us any code so a definitive answer is not possible. This is one of the reasons I prefer to work with ADO rather than datasets …

Member Avatar for mikeybware
0
154
Member Avatar for khair.ullah

Microsoft has an article, [Walkthrough: Deploying a Winidows Based Application](http://msdn.microsoft.com/en-us/library/k3bb4tfd%28v=vs.100%29.aspx) which should help.

Member Avatar for Reverend Jim
0
313
Member Avatar for MeSam0804
Member Avatar for Reverend Jim
0
3K
Member Avatar for mh.cool992

I think you should decide if you are going to post as hhm_pro992 or mh.cool992. Don't post as both and don't post the same code as both.

Member Avatar for Reverend Jim
-1
286
Member Avatar for hhm_pro992
Member Avatar for rodopeos.apostolos

Deleting the history from within the browser might not do it. I have noticed that even though I have IE and FireFox set to clear the cache and history on exit there is always "stuff" left behind. For example, after manually clearing the Firefox Cache and exiting, CCleaner reports that …

Member Avatar for gerbil
0
228
Member Avatar for predator78

The way communism was supposed to work was "from everone according to their ability and to everyone according to their need". That was the theory. In practice it always seemed to work out that those in power got and those who weren't didn't.

Member Avatar for mike_2000_17
2
734
Member Avatar for ct_hunny

This will trim a trailing comma from a string If str.EndsWith(",") Then str = str.Substring(0, Len(str) - 1)

Member Avatar for Reverend Jim
0
3K

The End.