Hello there all,
Firstly i want to start by saying this is NOT a school project, just something i am trying to create because i have a little bit of spare time in the holidays, and i am always eager to give something new a try.
I did do vB at school in 2006, but it wasn't until i join a forum, like this one, that i realized i was using and OLD and OUTDATED version, not 05 edition, and so i could not get any help anywhere, and decided to abandoned my personal project.
But lately i decided it is unlike me to give up on something i started and so i am here now asking for you help =D What Will My Program Do
My program, depending on the checked boxes and other various inputs, will create a simple text file. What Im Stuck With Right Now - If CheckBox1.CheckState = CheckState.Checked Then
-
write "example_example 2" to "Textbox1.text"
-
Else
-
write "example_example 0" to "Textbox1.text"
-
End If
Obviously my code is not working at all, and i have spent some time searching on the net for my answer but to not much avail.
As you can tell i am wanting the box if checked to write one thing, and if not to write another.
Not doubt i will need a hand later on in my project again, but for the time being a hand here would be great
Thanks all
- caek
6 1217
Is it the test of the checkbox that you're stuck on, or writing to the textbox or text file?
Also, I didn't catch which version you are using, just that it wasn't "05 version". Which is slightly ambiguous, given that a lot of us are using VB5 or VB6, while others use various versions of VB.Net including VB 2005.
Based on the checkstate business, I'd guess it's VB 2005?
Hello there all,
Firstly i want to start by saying this is NOT a school project, just something i am trying to create because i have a little bit of spare time in the holidays, and i am always eager to give something new a try.
I did do vB at school in 2006, but it wasn't until i join a forum, like this one, that i realized i was using and OLD and OUTDATED version, not 05 edition, and so i could not get any help anywhere, and decided to abandoned my personal project.
But lately i decided it is unlike me to give up on something i started and so i am here now asking for you help =D What Will My Program Do
My program, depending on the checked boxes and other various inputs, will create a simple text file. What Im Stuck With Right Now - If CheckBox1.CheckState = CheckState.Checked Then
-
write "example_example 2" to "Textbox1.text"
-
Else
-
write "example_example 0" to "Textbox1.text"
-
End If
Obviously my code is not working at all, and i have spent some time searching on the net for my answer but to not much avail.
As you can tell i am wanting the box if checked to write one thing, and if not to write another.
Not doubt i will need a hand later on in my project again, but for the time being a hand here would be great
Thanks all
- caek
I gave you a hand, but I do not think you heard me, get it:-)
I have been hinting trying out this download. How's VB 2005 workin'. Did you upgrade form VB 6? Looks like I'll need to wipe out my version of 6.0 if I download. You're in great hands, I'll stay quiet as I do not know too much in this arena. Good luck and have fun!
I gave you a hand, but I do not think you heard me, get it:-)
I have been hinting trying out this download. How's VB 2005 workin'. Did you upgrade form VB 6? Looks like I'll need to wipe out my version of 6.0 if I download. You're in great hands, I'll stay quiet as I do not know too much in this arena. Good luck and have fun!
i dont follow your sorry, are u mistaking me for someone else?
So now i am having the problem that if i have more then one command being written to the textbox it erases the first command and the 2nd takes it place, is there and easy way to mend this? - Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
'checkbox1
-
If CheckBox1.Checked Then
-
TextBox1.Text = "command_width 2"
-
Else
-
TextBox1.Text = "command_width 0"
-
End If
-
'checkbox2
-
If CheckBox1.Checked Then
-
TextBox1.Text = "command_length 2"
-
Else
-
TextBox1.Text = "command_length 0"
-
End If
-
End Sub
only writes either
command_length 2 or
command_length 0
thanks guys!
i dont follow your sorry, are u mistaking me for someone else?
So now i am having the problem that if i have more then one command being written to the textbox it erases the first command and the 2nd takes it place, is there and easy way to mend this?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'checkbox1
If CheckBox1.Checked Then
TextBox1.Text = "command_width 2"
Else
TextBox1.Text = "command_width 0"
End If
'checkbox2
If CheckBox1.Checked Then
TextBox1.Text = "command_length 2"
Else
TextBox1.Text = "command_length 0"
End If
End Sub
only writes either
command_length 2 or
command_length 0
thanks guys!
What I meant was, I applauded (gave you a hand) and you did not hear me. And you could not because we're communicating through a wire...Just being silly:-)
I am not sure what is happening to your code. I do have a question though. What is command_width...doing?
Are you just hoping Textbox1 reads command_width 0, 2 respectively? Looks like you will need different Textboxes for each CheckBoxes (i.e. TextBox1 for CheckBox1, TextBox2 for CheckBox2). I think I would need to write it as such in VB 6. I could be wrong for VB 2005, will leave it to professionals...
Any time you place a value in a textbox (or a variable, or generally just about anything) it will replace the prior value.
What that means is that if you want to achieve the effect of adding something onto the existing value, the new value that replaces it must include the old one. I'll show you what I mean. Consider these two pieces of code... - Dim s As String
-
s = "ABC"
-
s = "DEF"
-
s = "GHI"
This will produce the value " GHI" in variable s. - Dim s As String
-
s = "ABC"
-
s = s & "DEF"
-
s = s & "GHI"
This will produce the value " ABCDEFGHI" in variable s.
Sticking strings together in this way is generally referred to as "concatenating" them.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: RFox |
last post by:
I date back to the early days of the web when HTML was limited
but very managable, and have always maintained that hand-coding
HTML gives you far better control and cleaner HTML markup than
any...
|
by: Claude Vernier |
last post by:
Hi,
I already got a nice Web application running and need to adapt it for iPaqs,
Smartphone and Blackberry.
Can you suggest a better newsgroup if any and some links to find best
practices and...
|
by: M.Siler |
last post by:
I'm trying to get my head around a conversation I had with a developer the
other day. We were talking about Codesmith vs. Hand coding. He's position is
Codesmith is for junior to mid level...
|
by: M.Siler |
last post by:
I'm trying to get my head around a conversation I had with a developer the
other day. We were talking about Codesmith vs. Hand coding. He's position is
Codesmith is for junior to mid level...
|
by: M.Siler |
last post by:
I'm trying to get my head around a conversation I had with a developer the
other day. We were talking about Codesmith vs. Hand coding. He's position is
Codesmith is for junior to mid level...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |