473,388 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

A Hand Would Be Nice

3
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

Expand|Select|Wrap|Line Numbers
  1.         If CheckBox1.CheckState = CheckState.Checked Then
  2.             write "example_example 2" to "Textbox1.text"
  3.         Else
  4.             write "example_example 0" to "Textbox1.text"
  5.         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
Apr 3 '07 #1
6 1217
Killer42
8,435 Expert 8TB
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?
Apr 3 '07 #2
caek
3
Visual Basic 05 Express Edition?

http://msdn.microsoft.com/vstudio/express/downloads/

its a freebie

thanks for reply!

and im having trouble making the checkboxes place text into the textbox
Apr 3 '07 #3
Dököll
2,364 Expert 2GB
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

Expand|Select|Wrap|Line Numbers
  1.         If CheckBox1.CheckState = CheckState.Checked Then
  2.             write "example_example 2" to "Textbox1.text"
  3.         Else
  4.             write "example_example 0" to "Textbox1.text"
  5.         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!
Apr 3 '07 #4
caek
3
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?
Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         'checkbox1
  3.         If CheckBox1.Checked Then
  4.             TextBox1.Text = "command_width 2"
  5.         Else
  6.             TextBox1.Text = "command_width 0"
  7.         End If
  8.         'checkbox2
  9.         If CheckBox1.Checked Then
  10.             TextBox1.Text = "command_length 2"
  11.         Else
  12.             TextBox1.Text = "command_length 0"
  13.         End If
  14.     End Sub
only writes either

command_length 2 or
command_length 0

thanks guys!
Apr 3 '07 #5
Dököll
2,364 Expert 2GB
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...
Apr 3 '07 #6
Killer42
8,435 Expert 8TB
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...
Expand|Select|Wrap|Line Numbers
  1. Dim s As String
  2. s = "ABC"
  3. s = "DEF"
  4. s = "GHI"
This will produce the value "GHI" in variable s.
Expand|Select|Wrap|Line Numbers
  1. Dim s As String
  2. s = "ABC"
  3. s = s & "DEF"
  4. 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.
Apr 3 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

102
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...
1
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...
17
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...
17
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...
17
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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...
0
jinu1996
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.