|
I'm not sure I'm following, sorry. Can you try to describe in detail what the problem is. From what I got before the user types in a word they want to place. Lets say they type in 'Cat'. You need to pick tiles from your tray that represents a 'C', 'A', 'T'. If your tile object has a letter property you should be able to loop through your tiles and compare it with the letter you need. Once it matches you know you have your tile to place on the board. There isn't any need for 26 comparisons. You don't care what letter it is you just care that the letter needed matches the letter value of the tile.
If your trying to figure out how you know which image to use for which letter then I already gave you that code in the last post. If you don't understand the code I'll try to explain it, but at this point I'm not sure if that's the problem. As I said I'm not getting exactly what the problem is at this point. If I haven't helped please try to be as clear and detailed as possible so I understand what's going on and whats required.
|
|
|
|
|
thanks my game is working somehow... thanks for the help
|
|
|
|
|
Hello,
I Just wanted to let you know if any of you (c#\.net programmer) are looking to show off your skills or get involved in a project you might want to consider clamav. ClamAV is the leading openSource Antivirus, and right now they are looking for programmers to help with version 1.0 which would include an on acess scanner and possibly other features.
If you are intersted please post in the following post :
http://forums.clamwin.com/viewtopic.php?t=905
Thanks
Al968
Avast Antivirus-<url>http://www.avast.com<url>
|
|
|
|
|
Yes we need such antivirus (mine was not able to detect your spamming)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
What is it about Point #10[^] that you don't get?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
I need help converting the following code to VB.NET:
Open folder_file For Input As #1
Do While Not EOF(1)
Line Input #1, line_1
new_folder = full_folder & "\" & line_1
If Dir(new_folder, vbDirectory) = "" Then
MkDir new_folder
End If
Loop
Close #1
Thank you!
|
|
|
|
|
You'll want to use a streamreader object to read the file. You should be able to find examples online.
|
|
|
|
|
I have a For Next loop that places 9 Labels on to the form and gives each one a Tag=0.
When you click one of the labels it's text is changed to an X and it's Tag is changed to 1.
Or one of the labels text is changed to a O and it's Tag is changed to 10.
What I want help with is, how to check each label to find out if 3 of the labels have a tag of 1 or 10 in a row and if they do 'Winner'.
|
|
|
|
|
|
Thanks for the link will download the source and read it through it.
|
|
|
|
|
I am very new for VB.net (Visual Studio 2005) and also very new for SQL Server 2005 Express
I do have a Trial1.mdf install in Server Local c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Trial1.mdf
I tried to connect/open/close as the following codes:
<br />
Imports System.Data.SqlClient<br />
<br />
Public Class Form1<br />
<br />
Dim sqlConnection As New SqlConnection("server=localhost;uid=NULL;pwd=NULL;database= c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Trial1.mdf")<br />
<br />
sqlConnection.Open()<br />
sqlConnection.Close() <br />
End Class<br />
But it fail to run (even re-build no-error), can someone tell me what should I do to use my Trial1.mdf correctly?
Thanks for any help
|
|
|
|
|
Hi
For connecting to database, you need to provide UID, password and database. The .MDF file can be attached to the SQL Server.
For attaching the database, Check this link
Attaching Database[^]
After attaching, your database name will be the datasource in your connection string.
Hope this helps.
Harini
|
|
|
|
|
I did try as you said and it improves my issue, however I still can not open and use my trial1.mdf. Here my update codes:
<br />
Imports System.Data.SqlClient<br />
<br />
Public Class Form1<br />
'Link database<br />
Dim DB_Location = "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Trial1.mdf"<br />
Dim MyConnection = "Server=localhost; DataBase= " & DB_Location & "Integrated Security=SSPI"<br />
Dim sqlConnection As New SqlConnection(MyConnection)<br />
<br />
'Use database<br />
Dim strSQL As String = "SELECT FROM Trial1 WHERE col2 = 'trial' "<br />
Dim cmd As New SqlCommand(strSQL, MyConnection)<br />
<br />
sqlConnection.Open() ' ----> error<br />
cmd.ExecuteNonQuery() ' ----> error<br />
sqlConnection.Close() ' ----> error<br />
<br />
End Class<br />
At the last 3 line of codes I got the errors ... can you help me to correct it?
Thanks
|
|
|
|
|
I wrote a screen saver using the starter kit that came with VB 2005 Express. Worked great! Then I wanted it to kick off an application when it ended, thus:
.
.
'Code here validates a password
.
.
Process.Start("AppPath", "Params")
Thread.Sleep(2000)
Close()
With the screensaver active, I move the mouse. It asks for the secret word. I type the word. The application pops up. Two seconds later the screen saver and the application die together.
When I run the screen saver from the command line it works the way I want it to.
What do I have to do to make it work that way in screen saver mode?
JimT
|
|
|
|
|
Doesnt Windows control the activation/de-activation of screensavers? You probably have to dive deeper into the Windows APIs in order to control that behavior.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
The screen saver problem turns out to be one of ownership. If the operating system starts the screen saver because of inactivity, it is owned by the system, and it, along with everything it owns, goes in the dumper when some activity causes it to close. If you start it from the command line, or by clicking on it in Windows Explorer, or by clicking the preview button, you own it and it acts just like any other program; if it starts a child process, the child continues after the parent dies.
The problem, then, is to convince the OS that the child process does not belong to its parent. This is done by setting the UserName and Password parameters in the StartInfo structure before starting the child process. The only difficulty is that StartInfo.Password is not a System.String but a Security.SecureString, that is, it’s encrypted, so it takes a little doing to create it.
|
|
|
|
|
Did you just reply to yourself with the answer?
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
I was so desperate I was forced to think about it.
|
|
|
|
|
Well good job, now if I ever have the issue, Ill just refer to your reply to yourself.
CleaKO
"I think you'll be okay here, they have a thin candy shell. 'Surprised you didn't know that." - Tommy Boy "Fill it up again! Fill it up again! Once it hits your lips, it's so good!" - Frank the Tank (Old School)
|
|
|
|
|
right now i'm trying to add data to a database. i think i'm almost their but get this error message
"Property access must assign to the property or use its value"
this is what code i got
Imports System.Data.OleDb
Public Class Cust
Inherits System.Windows.Forms.Form
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim icount As Integer
Dim str As String
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PCBank.mdb;")
cn.Open()
str = "insert into customer values(" & CInt(tbID.Text) & ",'" & tbSur.Text & "','" &
tbFor.Text & "')"
'string stores the command and CInt is used to convert number to string
cmd = New OleDbCommand(str, cn)
icount = cmd.ExecuteNonQuery
MessageBox.Show(icount)
'displays number of records inserted
Catch
End Try
cn.Close()
End Sub
End Class
can anybody enliten me?
|
|
|
|
|
I might have the answer you seek, but I haven't looked in any depth at this problem. It may be something to do with the insert statement and/or the customer table. Does the table only have 3 columns: an id, a surname and a forename? Is the id column auto-generated (or whatever the term is in MS Access)? Try naming the columns in your insert statement. I don't know what columns your customer table has but it might be something like this: insert into customer (id, surname, forename) values (99, 'Rogers', 'Dave') Dave
|
|
|
|
|
Hello!
It is quite bit intrique because I am creating 80 buttons in runtime and assigning a name with an incremental value such as myButton.Name = "GButton_" + I.toString. Therefore, each button has a different name.
Dim I as Int32
For I = 1 to 5
Dim myButton as New Button
myButton.Name = "GButton_" + I.toString
me.controls.add(myButton)
Next
How can I reach the GButton_3.backcolor property somewhere in code (out of the procedure where I create the buttons). Would it be possible to define the name and set its property? Is there a way to use such as EVAL function to perform something eval( "GButton_" + I.tostring + ".backcolor=" + setcolor) THANK YOU.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Why throw away the reference to the button that you actually have, and then try to get it again?
Just store the references in an array so that you easily can access the buttons later.
---
single minded; short sighted; long gone;
|
|
|
|
|
hi,
it is easier as you think
either you iterate the "Controls" collection of the Form:
For Each ctl as Control In Me.Controls
If ctl.Name = "GButton2" Then
ctl.Backcolor ....
Exit For
End If
Next
or you just call the following:
Me.Controls("GButton2").Basckcolor ...
storing it in an array is not necessary, because the added controls are already stored in an collection (Me.Controls)
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Thank you! I will try it...
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|