473,394 Members | 1,769 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,394 software developers and data experts.

check box visual basic 6.0

17
I used four check box
named chk1,chk2,chk3,chk4 initialy all unchecked
when I check any one the caption is viewed in the text box where
I want to view it

if I uncheck the check box in following order it working fine
chk4,chk3,chk2,chk1

but when I uncheck the check box not in a particular way it does not work
properly
Feb 16 '07 #1
6 4857
Killer42
8,435 Expert 8TB
I used four check box ... but when I uncheck the check box not in a particular way it does not work properly
Please post your code, or at least give us a more detailed description of what you are doing with their captions.
Feb 16 '07 #2
debasisdas
8,127 Expert 4TB
It looks like your code is written only half the way
try to implemt the same for all the controls

or

user control array
Feb 17 '07 #3
anirban
17
Please post your code, or at least give us a more detailed description of what you are doing with their captions.
part of the code
there are three another three not send to you

Expand|Select|Wrap|Line Numbers
  1. Private Sub chk4_Click()
  2. If chk4.Value = 1 Then
  3. txt1.Text = Trim(txt1.Text) + " " + Trim(chk4.Caption)
  4. End If
  5. If chk4.Value = 0 Then
  6. txt1.Text = " "
  7. If chk1.Value = 1 Then
  8. txt1.Text = Trim(txt1.Text) + Trim(chk1.Caption)
  9. End If
  10. If chk2.Value = 1 Then
  11. txt1.Text = Trim(txt1.Text) + Trim(chk2.Caption)
  12. End If
  13. If chk3.Value = 1 Then
  14. txt1.Text = Trim(txt1.Text) + Trim(chk3.Caption)
  15. End If
  16. End If
  17. end sub
Feb 18 '07 #4
Check this code

Expand|Select|Wrap|Line Numbers
  1. Private Sub chk4_Click()
  2.     chkBoxClick
  3. End Sub
  4. Private Sub chk3_Click()
  5.     chkBoxClick
  6. End Sub
  7. Private Sub chk2_Click()
  8.     chkBoxClick
  9. End Sub
  10. Private Sub chk1_Click()
  11.     chkBoxClick
  12. End Sub
  13.  
  14. Private Function chkBoxClick()
  15. txt1.Text = ""
  16. If chk1.Value = 1 Then
  17.     txt1.Text = txt1.Text & " " & chk1.Caption
  18. End If
  19. If chk2.Value = 1 Then
  20.     txt1.Text = txt1.Text & " " & chk2.Caption
  21. End If
  22. If chk3.Value = 1 Then
  23.     txt1.Text = txt1.Text & " " & chk3.Caption
  24. End If
  25. If chk4.Value = 1 Then
  26.     txt1.Text = txt1.Text & " " & chk4.Caption
  27. End If
  28. End Function
Feb 18 '07 #5
Killer42
8,435 Expert 8TB
Good advice there, sukeshchand.

And keep in mind, anirban, that a control array will make this sort of thing much simpler to work with. The main reason being, you would then be able to use a loop to process all of them with less code.
Feb 18 '07 #6
anirban
17
thanks the problem is solved by your suggestion
Mar 19 '07 #7

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

Similar topics

3
by: pix | last post by:
Hello, I would like to start learning Visual Basic, and I was wondering if there are any recomendations to any ebooks, or actual books for that matter. I have my eye on this book by John Smiley,...
2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
9
by: sleepyant | last post by:
Hi, I've posted this question on several forum but have no response. So I hope anyone who have any idea what I'm talking about please give your solution or advice. My problem is I need to check...
0
by: JayC | last post by:
Hello everybody this is my first post, please forgive any etiquette errors. Anyway I bought Visual Basic .NET, C++ .NET, and C# .NET all separately and at the end of all three installs I selected...
10
by: Li Pang | last post by:
Hi Anybody knows how to check a network server is available (pingable) Many thanks in advance.
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
1
by: Vayse | last post by:
In VS2005, clicking on Help/Check for Updates is no longer working. Is there an address I can check to see if I'm on the latest version? Thanks Vayse P.S. Currently on: Microsoft Visual Studio...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
3
by: shapper | last post by:
Hello, How to I check if a user is authenticated and if it is what is its role? I am using Asp.Net 2.0 and forms authentication. Thanks, Miguel
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.