smallcap program with checkbox
Page 1 of 112 Replies - 323 Views - Last Post: 31 January 2013 - 11:02 PM
#1
smallcap program with checkbox
Posted 29 January 2013 - 01:45 AM
Replies To: smallcap program with checkbox
#2
Re: smallcap program with checkbox
Posted 29 January 2013 - 03:01 AM
If RadioButton1.Checked = True Then
TextBox1.Text = TextBox1.Text.ToLower
Elseif RadioButton2.Checked = True then
TextBox1.Text = TextBox1.Text.ToUpper
End If
This post has been edited by kai_itz me: 29 January 2013 - 03:33 AM
#3
Re: smallcap program with checkbox
Posted 29 January 2013 - 03:28 AM
kai_itz me, on 29 January 2013 - 03:01 AM, said:
If RadioButton1.Checked = True Then
TextBox1.Text = TextBox1.Text.ToLower
Else RadioButton2.Checked = True
TextBox1.Text = TextBox1.Text.ToUpper
End If
no i couldn't get it properly please give me a clear code in with checkbox only please and i have send attachement please check
#4
Re: smallcap program with checkbox
Posted 29 January 2013 - 03:39 AM
Private Sub Button1_Click()
If CheckBox1.Checked = True Then
TextBox1.Text = TextBox1.Text.ToLower
Elseif CheckBox2.Checked = True then
TextBox1.Text = TextBox1.Text.ToUpper
End If
End Sub
This post has been edited by kai_itz me: 29 January 2013 - 03:52 AM
#5
Re: smallcap program with checkbox
Posted 29 January 2013 - 03:49 AM
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBox1.Checked = True Then
TextBox1.Text = TextBox1.Text.ToLower
End If
If CheckBox2.Checked = True Then
TextBox1.Text = TextBox1.Text.ToUpper
End If
If (CheckBox1.Checked = True) And (CheckBox2.Checked = True) Then
TextBox1.Text = "choose only one checkbox"
End If
End Sub
I FORGOT TO MENTION THE ABOVE CODE IS IN VB10...SORRY
This post has been edited by kai_itz me: 29 January 2013 - 04:32 AM
#6
Re: smallcap program with checkbox
Posted 29 January 2013 - 04:45 AM
TextBox1.Text = Ucase(TextBox1.Text)
and LCase.
#7
Re: smallcap program with checkbox
Posted 29 January 2013 - 04:52 AM
Private Sub command1_Click()
If Check1.Value = 1 Then
Text1.Text = LCase(Text1.Text)
End If
If Check2.Value = 1 Then
Text1.Text = UCase(Text1.Text)
End If
If (Check1.Value = 1) And (Check2.Value = 1) Then
Text1.Text = "choose only one checkbox"
End If
End Sub
This post has been edited by kai_itz me: 29 January 2013 - 04:54 AM
#8
Re: smallcap program with checkbox
Posted 29 January 2013 - 05:09 AM
If Check1.Value = 1 Then
(the value is more likely to be -1 anyway)
.checked should work:
If Check1.Checked Then
This post has been edited by andrewsw: 29 January 2013 - 05:10 AM
#9
Re: smallcap program with checkbox
Posted 29 January 2013 - 05:19 AM
Quote
.checked not going to work in vb6 . it will give error
method or data member not found
ALSO
Quote
it too will not work as i think for checkbox value
(true = 1 and false = 0)
THE ABOVE CODE IS PERFECTLY WORKING.
This post has been edited by kai_itz me: 29 January 2013 - 05:27 AM
#10
Re: smallcap program with checkbox
Posted 29 January 2013 - 05:45 AM
VB6 uses .value rather than .checked and being checked has the value 1 (or vbChecked) rather than the boolean true/-1.
This post has been edited by andrewsw: 29 January 2013 - 05:47 AM
#11
Re: smallcap program with checkbox
Posted 29 January 2013 - 06:41 AM
Just my preference as I can never remember what the numbers relate to.
This post has been edited by maj3091: 29 January 2013 - 06:42 AM
#12
Re: smallcap program with checkbox
Posted 29 January 2013 - 08:52 PM
#13
Re: smallcap program with checkbox
Posted 31 January 2013 - 11:02 PM
andrewsw, on 29 January 2013 - 06:45 AM, said:
VB6 uses .value rather than .checked and being checked has the value 1 (or vbChecked) rather than the boolean true/-1.
The reason that it isn't a boolean value is because there are three possible values, as maj has pointed out. If you convert the value to boolean you will get -1 for both checked and grayed, and 0 for unchecked. I still remember struggling with this back in the VB4 days.
This post has been edited by BobRodes: 31 January 2013 - 11:04 PM
|
|

New Topic/Question
Reply



MultiQuote





|