|
You could try a For statement.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
could you give an example please?
|
|
|
|
|
Well, it would help if I could see your current code.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Ok, the current code is like this (i know its amateurish, but it was the only way i could get it working!)
Private Sub txtInput1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtInput1.TextChanged
'If statement to check correct inputted value
If txtInput1.Text = lblLetter1.Text Then
'Letter goes green to signify the entry and being correct
lblLetter1.ForeColor = Color.Green
'Adds 1 to the intScoreAll global value
intScoreAll = intScoreAll + 1
'Else statement if incorrect value is inputted
Else
'Letter goes red to signify the entry and being incorrect
lblLetter1.ForeColor = Color.Red
End If
'Disables the input box to stop cheating
txtInput1.Enabled = False
'Selects the next txtInput box for key entry
txtInput2.Select()
End Sub
|
|
|
|
|
You should be able to put a for loop around the if-endIf statement. I forgot the exact syntax for VB.NET but it looks like this in VC#.NET.
<br />
for(int i=0;i<10;i++)<br />
{<br />
if(txtInput1.Text==lblLetter1.Text)<br />
{<br />
lblLetter1.ForeColor=Color.Green;<br />
intScoreAll+=1;<br />
}<br />
else <br />
{<br />
lblLetter1.ForeColor=Color.Red;<br />
}<br />
}<br />
txtInput1.Enabled=false;<br />
txtInput2.Select();<br />
Well that is how you would use a for-loop but it may be better for you if you just set up a global counter that is incremented by 1 whenever this method is used and when the value reaches 10 then exit. The loop for you in this method would not necessarily work becuase it would do the for loop on the same text that is in the textbox at one time without new text being entered for every of the ten times.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Help Me!!!
Dear Expert,
Hi!
I am very happy to use Crystal Report in my VB.NET project.
Right now I need a little help on how to display JPG file by XML file dynamically.
I mean I put File Path into XML file and then display them on Crystal report.
I know Formula Fields and Database Fields.
I don't know how to set up it for picture to insert into the Crystal Report.
Please tell me how to set up Formula Fields on Crystal Report XI.
like @Command([FileImport];"JPGImage","C:\\mypic\office.jpg"),
however the file path is in XML file. I put them into each row of a Dataset's dataTable.
or @Filepath(XML file)
email: enter2000 at yahoo.com
Thanks so much for the help!
I am looking forward to receiving your reply!
Lena
|
|
|
|
|
How do you store and HIDE information (such as passwords) so nobody can find/edit/delete/view them?
Richard Faulkner
Founder of GallantTechnologies
|
|
|
|
|
_Richard Faulkner wrote: How do you store and HIDE information (such as passwords) so nobody can find/edit/delete/view them?
I don't. If "nobody"* can find/edit/delete/view some piece of information neither can your program.
By allowing your program access you must be open to the possibility that someone may be able to find/edit/delete/view the information. At this point your strategty must turn to minimising the risk of that happening.
In order to do that you need to know what the information is? why it needs to be hidden? What are legitimate reasons to edit it? What are legitimate reasons to delete it? What are legitimate reasons to view (read) it?
Information can be placed in many places: files, the registry, in a database, as an embedded resource in an assembly.
Information can be hidden by many techniques: encryption, steganography (placing it in highly unusual places, e.g. IP packet headers, in a picture or audio stream)
* Which is an empty set
|
|
|
|
|
|
Never store a password - instead store the one-way encrypted version of the password and test any input against that. (RSA or SGK[^] is a good example)
|
|
|
|
|
I want to know how to execute code typed in a text box on a windows form. In other words. How do you make a program that executes vb.net/vb code typed in a textbox on a form when a button is pressed?
Richard Faulkner
Founder of GallantTechnologies
|
|
|
|
|
This can actually be done, and given the nature of the .NET framework, it's not surprising. I am sorry to say, I don't recall how tho ( I've not done it ). What is your intended use ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You're lucky today, there's someone here on the codeproject that wrote an article on NScript. This is a scripting engine that can run some .NET languages like VB.NET in your application. Take a look: http://www.codeproject.com/dotnet/nscript.asp[^]
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
I am trying to make a program that "copies" the contents of everything behind the form (like CopyFromScreen). My only problem is that I want it to update itself every 1-75 milliseconds without any flicker. I am trying to do this because, for example, if I add a PNG of, let's say, an apple, it will appear that it will appear to be floating on the desktop. I am trying to mock layered windows, but I am also trying to avoid using them because I want to use controls on the form, too.
Richard Faulkner
Founder of GallantTechnologies
|
|
|
|
|
|
Does anyone know how to make an instant messenger with VB.Net that is similar to AIM?
Richard Faulkner
Founder of GallantTechnologies
|
|
|
|
|
http://www.developersdex.com/gurus/code/555.asp
http://samples.gotdotnet.com/QuickStart/howto/default.aspx
|
|
|
|
|
|
ok so i am making a program with a database connected to it and when i run the program in the IDE it works fine but when i install it and run it, it talks about not being able to find the database. Now my question is... when you make a program with a database, isn't the program supposed to copy to database to where ever it is supposed to read from and if it isnt then where\how to i get the program to copy and read the database upon installation. Also, i am keeping on the back burner the fact that when i install the program i want to be able to go into the database and change information and/or be able to print reports on the data.
|
|
|
|
|
Karma31251 wrote: when you make a program with a database, isn't the program supposed to copy to database to where ever it is supposed to read from
A program won't do anything unless you tell it to.
Karma31251 wrote: how to i get the program to copy and read the database upon installation
What database technology are you using?
|
|
|
|
|
Are you using ADO?
try capturing the error in a try/catch, that will give you a clue as to the actual error.
|
|
|
|
|
You might want to respond to the original poster, rather than me.
Also, you'll get much more information if you let the debugger catch the error.
|
|
|
|
|
Conversions
What is this and is it better to use than things like CStr, CDate, .ToString etc...?
Cleako
|
|
|
|
|
you should never use CStr/CDate. This is VB6 holdover stuff. Convert.ToXXX is your best bet, unless you don't know if the input is clean, then stuff like int.TryParse should be your first port of call.
In C# you can do this:
object o;
...
MyClass x = o as MyClass;
in this instance, x will be null if o is not an instance of myClass. You can also do this
if (o is MyClass)
{
// o is an instance of MyClass
}
I am sure VB can do the same, but I don't know the syntax.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to know how to design a 3-tier Architecture. Could you give me some information for example document or books to teach it. Thank you
|
|
|
|