473,499 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

viable solution?

Instead of impementing icomparer for a custom calendar class to find a
button
with a particular date property value I have done the following:
'on a form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim b As calBut = Me.Calendar1.CallButton(#10/8/2004#)
Console.WriteLine(b.Date)
End Sub
'the calendar control
Public Class Calendar
Inherits System.Windows.Forms.UserControl
'......

Public Event CallingButton(ByVal d As Date)
Public calledbutton As calBut
Function CallButton(ByVal d As Date) As calBut
calledbutton = Nothing
RaiseEvent CallingButton(d)
Return calledbutton
End Function

End Class

'calendar button class
Public Class calBut
Inherits Button

'......

Friend Sub OnCallingButton(ByVal d As Date)

If d = Me.Date Then
Dim parent As Calendar = DirectCast(Me.Parent, Calendar)
parent.calledbutton = Me
End If
End Sub

End Class
Nov 21 '05 #1
3 1141
what's the actual question?
"Nathan Carroll" wrote:
Instead of impementing icomparer for a custom calendar class to find a
button
with a particular date property value I have done the following:
'on a form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim b As calBut = Me.Calendar1.CallButton(#10/8/2004#)
Console.WriteLine(b.Date)
End Sub
'the calendar control
Public Class Calendar
Inherits System.Windows.Forms.UserControl
'......

Public Event CallingButton(ByVal d As Date)
Public calledbutton As calBut
Function CallButton(ByVal d As Date) As calBut
calledbutton = Nothing
RaiseEvent CallingButton(d)
Return calledbutton
End Function

End Class

'calendar button class
Public Class calBut
Inherits Button

'......

Friend Sub OnCallingButton(ByVal d As Date)

If d = Me.Date Then
Dim parent As Calendar = DirectCast(Me.Parent, Calendar)
parent.calledbutton = Me
End If
End Sub

End Class

Nov 21 '05 #2
Viable solution?
"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
what's the actual question?
"Nathan Carroll" wrote:
Instead of impementing icomparer for a custom calendar class to find a
button
with a particular date property value I have done the following:
'on a form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim b As calBut = Me.Calendar1.CallButton(#10/8/2004#)
Console.WriteLine(b.Date)
End Sub
'the calendar control
Public Class Calendar
Inherits System.Windows.Forms.UserControl
'......

Public Event CallingButton(ByVal d As Date)
Public calledbutton As calBut
Function CallButton(ByVal d As Date) As calBut
calledbutton = Nothing
RaiseEvent CallingButton(d)
Return calledbutton
End Function

End Class

'calendar button class
Public Class calBut
Inherits Button

'......

Friend Sub OnCallingButton(ByVal d As Date)

If d = Me.Date Then
Dim parent As Calendar = DirectCast(Me.Parent, Calendar)
parent.calledbutton = Me
End If
End Sub

End Class

Nov 21 '05 #3
Does it work???

Then yes... it's a viable solution.
"Nathan Carroll" <th************@Bhutan.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Viable solution?
"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
what's the actual question?
"Nathan Carroll" wrote:
Instead of impementing icomparer for a custom calendar class to find a
button
with a particular date property value I have done the following:
'on a form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim b As calBut = Me.Calendar1.CallButton(#10/8/2004#)
Console.WriteLine(b.Date)
End Sub
'the calendar control
Public Class Calendar
Inherits System.Windows.Forms.UserControl
'......

Public Event CallingButton(ByVal d As Date)
Public calledbutton As calBut
Function CallButton(ByVal d As Date) As calBut
calledbutton = Nothing
RaiseEvent CallingButton(d)
Return calledbutton
End Function

End Class

'calendar button class
Public Class calBut
Inherits Button

'......

Friend Sub OnCallingButton(ByVal d As Date)

If d = Me.Date Then
Dim parent As Calendar = DirectCast(Me.Parent, Calendar)
parent.calledbutton = Me
End If
End Sub

End Class


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2360
by: Wayne Wengert | last post by:
I have a solution. I want to clone it to try some different options. Is there a way to open Solution A, save it as Solution B and then be able to try some things in Solution B without affecting...
1
3595
by: Paul Stanial | last post by:
How viable is it to use MS Access as a front end (via ODBC) to a SQL Server 2000 database? The users would access via the internet using a netgear vpn setup. Thanks, Paul S
10
510
by: Simon Jefferies | last post by:
Hello, I'm getting a strange problem where when I load up my solution that has three projects:- a managed C++ .NET, one C++ lib, and a VB library. It locks up and doesn't load completely, I...
4
1443
by: ilPostino | last post by:
I'm trying to find out if its possible to call webservices from a browser using c# or maybe some other script? I know the client would have to have ..net installed which is fine but I can't find...
1
1369
by: paul.drummond | last post by:
Hi all, I am new to whole idea of "web services" and architectures such as .NET and J2EE so please bare with me. I am trying to research as much as possible before asking silly questions but...
3
2140
by: Manikandan | last post by:
Hi, I'm copying projects from a solution in the vss. In my local system i created solution ,added that project(make modification related to solution) When i added this solution to vss, projects...
0
2325
by: techie | last post by:
List of Solution manuals: Engineering Circuit Analysis 6Ed - Hayt Solutions Manual Norbury - Solutions manual for mechanics and thermodynamics Physics For Scientists And Engineers - Solution...
1
1088
by: DBC User | last post by:
So far all the examples I have seen been working with simple XML files. Just curious, is Linqq a viable solution for handling a large XML file, when I say large, it means it has almost 2K+ nodes in...
6
1319
maxx233
by: maxx233 | last post by:
I have a problem I've been butting my head up against for a while, and I really have no viable solution figured out yet :\ I would have designed the database a bit different, and certainly designed...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7229
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...
1
6905
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...
0
7395
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...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.