|
-
Jul 23rd, 2004, 01:52 AM
#1
Thread Starter
Addicted Member
Help
Private Sub Button1_ClickEvent_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickEvent
Dim cf2 As New CrossfireForm2
If (DatePicker1.Value >= Now.AddDays(-1)) Then
cf2.TextBox1.Text = DatePicker1.Value
cf2.Refresh()
cf2.Show()
'Me.Hide()
'End If
ElseIf (DatePicker2.Value >= Now.AddDays(-1)) Then
cf2.TextBox1.Text = DatePicker2.Value
cf2.Refresh()
cf2.Show()
'Me.Hide()
'End If
ElseIf (DatePicker3.Value >= Now.AddDays(-1)) Then
cf2.TextBox1.Text = DatePicker3.Value
cf2.Refresh()
cf2.Show()
'Me.Hide()
End If
Me.Hide()
End Sub
I cant pass the DatePicker1,2,3.Value to cf2 which is form2's textbox
-
Jul 23rd, 2004, 02:31 AM
#2
PowerPoster
Hi,
Make sure the cf2.Modifiers property is not set to Protected or Private in the design mode, and
VB Code:
cf2.TextBox1.Text = cstr(DatePicker3.Value)
In VB.NET, the Text property Type of TextBoxes & similar is a String not a variant as in VB6.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 23rd, 2004, 03:11 AM
#3
Thread Starter
Addicted Member
I tried changing it as Public but still cant get the exact date.
Private Sub Button1_ClickEvent_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickEvent
Dim cf2 As New CrossfireForm2
If (DatePicker1.Value() >= DateTime.Today.ToString()) Then
cf2.TextBox1.Text = CStr(DatePicker1.Value)
cf2.Refresh()
cf2.Show()
'Me.Hide()
'End If
If (DatePicker1.Value >= DateTime.Today.ToString()) Then
cf2.TextBox1.Text = CStr(DatePicker2.Value)
cf2.Refresh()
cf2.Show()
' 'Me.Hide()
' 'End If
If (DatePicker1.Value >= DateTime.Today.ToString()) Then
cf2.TextBox1.Text = CStr(DatePicker3.Value)
cf2.Refresh()
cf2.Show()
' 'Me.Hide()
End If
End If
End If
Me.Hide()
End Sub
-
Jul 23rd, 2004, 07:18 AM
#4
PowerPoster
Hi,
Are you sure that is your problem. I think you are not seeing cf2.
Amend all your cf2.Show to cf2.ShowDialog.
Also have you noticed that all three of your If clauses check the condition of DatePicker1?????
The Me.Hide does not seem to work
In
If (DatePicker1.Value() >= DateTime.Today.ToString()) Then
if you have Option Strict On then this will not compile. It should be
If DatePicker1.Value() >= DateTime.Today Then
Last edited by taxes; Jul 23rd, 2004 at 08:28 AM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|