Re: One form Multiple uses.
If it works, why brake it?
Re: One form Multiple uses.
The reason is, because my final solution has 9 forms, which are all very similar.
Why have 3 forms for searching, when i could have 1
See what i mean ?
Re: One form Multiple uses.
Post a screenshot of one of your search forms and show us which controls are being redundant on the other 2 search forms. Without seeing the actual form, it's really hard for anyone to give you any suggestions.
Re: One form Multiple uses.
So you want the Search to search text in the textbox?
Unfortunately the way I know only works on RichTextBoxes, and it's .
Re: One form Multiple uses.
Thanks Stanav. I'll get my VERY slow laptop to open the application, and show you.
Re: One form Multiple uses.
Quote:
Originally Posted by
VOT Productions
So you want the Search to search text in the textbox?
Unfortunately the way I know only works on RichTextBoxes, and it's
.
No - Ill post the algorithum up in a minute, you will see what i mean.
Edit: it might be a little while, as I will have to logon to the college network and get the updated version from there. Sorry :L
Re: One form Multiple uses.
OK, and it's algorithm not algorithum.
Re: One form Multiple uses.
Quote:
Originally Posted by
VOT Productions
OK, and it's algorithm not algorithum.
:blush: - you can tell im a VERY sloppy person :D
Re: One form Multiple uses.
Take as long as you want, but not 1 week.
Re: One form Multiple uses.
Quote:
Originally Posted by
VOT Productions
Take as long as you want, but not 1 week.
Sorry for the delay, I forgot to make a backup of the project onto my memory stick! :@... and you know what its like living in the middle of the countryside!.
Re: One form Multiple uses.
Code:
Private SubBtnCustomerSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCustomerSearch.Click
FileInitCustomer()
Dim tempCustomer2 As CustomerInfo = Nothing
Dim blnFound As Boolean = False
'the search terms are padded out to match the saved string format
Dim strFirstNameF As String = String.Format("{0,-20}", txtSearchFirstName.Text)
Dim strLastNameF As String = String.Format("{0,-20}", txtSearxhLastName.Text)
Dim intfilenum3 As Int16 = FreeFile()
FileOpen(intfilenum3, strCustomerFileName, OpenMode.Random, OpenAccess.ReadWrite, , intCustomerRecLen)
Dim intRec As Int16 = 0
Do Until intRec = intCustomerNumRecs Or blnFound
'read next rec
intRec = intRec + 1
FileGet(intfilenum3, tempCustomer2, intRec)
'if name matches
If tempCustomer2.strFirstName = strFirstNameF And tempCustomer2.strLastname = strLastNameF Then
blnFound = True
RecFound = intRec
End If
Loop
FileClose(intfilenum3)
If blnFound Then
GetRecCustomer(RecFound)
DisplayRecCustomer()
Else
MsgBox("Customer Not Found")
End If
End Sub
Re: One form Multiple uses.
Well a piece of advice is have a up to date version on every PC.
Re: One form Multiple uses.
Quote:
Originally Posted by
VOT Productions
Well a piece of advice is have a up to date version on every PC.
I've Learn't my lesson from this :)
Re: One form Multiple uses.
Just some comments on your code:
1. Get rid of those VB6 legacy methods (FileOpen, FileGet, FileClose...) and use standard .Net methods.
2. Use a database to store your data instead of a flat text file. If you use a database, you may not need to use any of those FileOPen, FileGet... method at all. However, it also introduces you to ADO.Net which may take a little while to get familiar with.