
netnewb2002
Members-
Posts
13 -
Joined
-
Last visited
About netnewb2002
- Birthday 04/23/1982
Personal Information
-
Occupation
Student - Work for Pinkerton Security
netnewb2002's Achievements
Newbie (1/14)
0
Reputation
-
I'm making a quesiton/answer based program. I have about everything working on it except for this... How do I store values inside radio buttons? For example, What I would like to do is: After chosing an answer for the previous question, and going to the next question, chosing another answer for that question. Then going back to the previous question, and I would like to have it to show what I answered for that question, and vise versa. Almost everything I tried gave an error, and forced me to exit the program, heh. Here's what I've tried, hopefully, I'm not too far off. I set variables: dim a, b, c as string 'This one didn't work, on the next question, it changed previoius answers. if rdoA.checked=true then a="A" Else If rdoB.checked= true then b="B" Else if rdoC.checked=true then c="C" end if end if 'I tried just reversing the check state, didn't work though, it made each of them selected continuously. dim a as string="A" dim b as string="B" if a="A" then rdoA.checked=true Else rdoB.checked=false 'Tried to nest it into my if statements, that gave the microsoft send error report message., had to exit program. dim x as integer 'i have statements here for the list box//question//answer//valadation checks arrays 'tried using same code from above if x <4then if x=0 then if rdoA.checked=true then a="A" Else If rdoB.checked= true then b="B" Else if rdoC.checked=true then c="C" end if end if end if end if Any ideas of what I might do differently? Links//Help would be appreciated. Thanks,
-
Working with the start/stop at moment. I did do the first example for the coding techniques..all it did is put current date and time inside a label on a form, which I already knew how to do.
-
I had a question, This is for part of a program due for a class. I know how to make regular timers, but where can I find sample code for (stop watch) Timers? So when I push start..the timer will start, and when I push stop the timer will stop. I looked through both of my text books for sample code on this and couldn't find any. Unless it is labeled something other than timer/objects/modules. Text books I use are: VB.NET by Example, and Coding Techniques for Microsoft Visual Basic.NET. Any help would be appreciated, or perhaps a sample code of what I should do first, and maybe I can figure the rest out from there. Thanks,
-
Nice, still looking through your code to see how everything works. I was working on it awhile also..still didn't figure it out though lol. Thanks for making a program to show me. :( = :confused: = :-\ = :D
-
I'm sorry, when you have time could you please provide an example program? I'm in no hurry, I'm trying to figure this code out. Some day I might actually know what I'm doing in Visual Basic.net. Thanks for the help and quick responses. :) later,
-
Sorry, bit confused on where to put this: Public CurWord As String = txtWord.Text txtWord.PasswordChar = "" For I = 0 To txtWord.Text.Length txtWord.Text = Replace$(txtWord.Text, txtWord.Text.Char(I), "*") Next txtGuess.MaxLength = txtWord.Text.Length What do I declare "I" as? I tried string, integer, but, either one I try I get an blue line ...build error.
-
Another question, :/ How would I subsitute a letter in for the asterik for the text box? So, if i had a word like "meat" which shows up like "****", and i wanted to subsitute an e for the asterik, how would I try to do that? **** <--Meat *e** <--Meat
-
Thank you That worked great, I understand your method, much easier than what I was trying to do. hehe. Thanks for the help. :cool:
-
I'm trying to create a guessing game. Is there any sample code / Links for subsituting asteriks in for the word in .NET? It would be the same word but hidden by the asteriks, and how would I subsitute a letter in those asteriks? I started out trying to read a random word from file to the text box: Dim sWords() As String ' hold words from file Private Sub frmguess_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'read in the file Dim fs As FileStream Dim reader As StreamReader fs = New FileStream("words.txt", FileMode.Open) 'word to bin directory reader = New StreamReader(fs) 'Read in the words While reader.Peek <> -1 If sWords Is Nothing Then ReDim Preserve sWords(0) Else ReDim Preserve sWords(sWords.GetUpperBound(0) + 1) End If sWords(sWords.GetUpperBound(0)) = reader.ReadLine 'read in the word 'txtwords.text=swords /// ? End While Can't seem to get the word from the file to display in the textbox. Any Ideas? Thanks.
-
Thanks for the assistance, the substring worked great :) Thanks,
-
Tamandt, Just tried this, I used 1234567 and 1-7 for numpad txtcenter.text=1234567 for 1 txtcenter.text=123456 for 2 and so on. :(
-
I tried inputing this for code. It did almost the same thing as the mid() function. For example: I input 1234567 and say I had 4 for the num pad. txtleft=1234 txtcenter=567 txtright=7654 Center is off a little still :( I tried modifying the code a little just to see what would happen. txtcenter.Text = input.Substring(nud1.Value\2, input.Length \2 ) Using the same input of 1234567 and numpad of 4 txtcenter=345 which seems about right, till I change the value of the numpad... lets say 5 txtcenter.text=345 still If I change the value to 6 txtcenter.text=456 which is still wrong. If everything is correct, this should happen: If I put in a 1 for the numpad, and 12345 for txtinput.text txtleft=1 txtright=5 txtcenter=3 If I would change it to 3 instead of one txtleft=123 txtright=543 txtcenter= 234 Any other suggestions?
-
Hello, I need some help with .NET for Visual Basic. Probably is extremely easy for you pros, but it's sure giving me a head ache. I have a textbox, named txtinput.text and a numpad, named nud1.value. At runtime text will be inputed into txtinput, and the numpad: Whether clicked up or down will display the left letters, center letters, and right letters, of the string. I've have figured out how to get the left and the right side to work properly, but for the center, I have no clue. txtleft.text 'displays the left side of the string txtcenter.text 'displays the center of the string txtright.text 'displays the right side of the string This is my code for the numpad. No idea on how to get the center of the string to display correctly, any help? I deleted the mid function I tried, cause at run time it would start way out at the right end of the string, and go backwards when I clicked the numpad. Private Sub nud1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nud1.ValueChanged Dim input As String 'declaring as string input = txtinput.Text 'input = textbox txtright.Text = Strings.Right(input, nud1.Value) 'will input each letter from right to left according to nud value input = txtinput.Text 'input = textbox txtleft.Text = Strings.Left(input, nud1.Value) 'will input each letter from right to left according to nud value If nud1.Value > Len(input) Then 'if nud1.value is greater than the string length and error box will appear MsgBox("doesnt go that high, try agian", MsgBoxStyle.Critical, "String Handler") End If End Sub Thanks, Netnewb2002