Re: VB or C# for SQL Server



Bob,
I was just reading through the posts, and got to the part where you
mentioned the issue of Button_Click, and how nothing was happening when you
moved it to a module. I thought, with a little more detail I could offer a
suggestion, so my post had nothing to do with the original thread, perhaps I
should have made that clear in the subject line, but I thought it was the
best thing to do, since the question was presented under this subject.

I was actually doing something similiar, where I needed to control the
visibility of a group of controls. I used a custom control to encapsulate
that, just setting the visibility of the control to take care of the
visibility of it's child controls.

As for the module, something like so would work:

Module Module1
Public Sub Button_Click(Sender As Object, E As EventArgs )
MessageBox.Show( "clicked" )
End Sub
End Module

Class Form1
Public Sub New()
AddHandler( myButton.Click, AddressOf Module1.Button_Click)
End Sub
End Class

>>Sorry you felt your time was wasted, and that you took the time to respond
>>as such.

Out of character on my part, my apologies,

Good day, Ron

Then, in code you could wire that to your Button1, and keep that aspect of
the button click in a separate module. Although I feel thats not still not
the best solution.
"Bob" <nojunk@xxxxxxxxxxxxxx> wrote in message
news:3VaOe.3860$Vg7.851@xxxxxxxxxxx
> Ron:
>
> I'm confused at how your <snip> regarding my Module issue pertains to
> other recent posts.
>
> Anyways, My dig at VB.NET and C# was simply a joke. I thought maybe some
> people would get a laugh. I've been playing with both and actually like
> them both despite the fact that MS fixes sum bugs, creates new ones,
> chages some of the minor aspects of VS and says ALL NEW VERSION, when it
> should be a service pack.
>
> Those are my feelings on that. If thats what your refering to. If your
> unsure about why I feel that way, then think about when the last time is
> that MS released a major service pack for any VS.NET version.
>
>>Sorry you felt your time was wasted, and that you took the time to respond
>>as such.
>
> I'm at a loss on that one too. You can elaborate if you wish but quite
> frankly, i'm tired of that topic.
>
> If your refering to my dig at Cor, then the fact is, he blew me off on a
> completely different topic after two days of making me elaborate on the
> problem I was having.
>
> As for my moving the Panels visible property to a module, All I did was
> double click the button in designer and begin putting that code in the
> bottons click event. When I'm done, I will have 26 panels. I would like to
> move the code for the visible = true and such to a Module and out of the
> form for better code organization.
>
> I tried the following in the Module:
>
> Module ModPanels
>
> Sub btn1Click()
> Dim frm1 As New Form1
>
> frm1.Label01.Visible = True
> frm1.Panel01.Visible = True
>
> frm1.Panel02.Visible = False
> frm1.Label02.Visible = False
>
> frm1.Panel03.Visible = False
> frm1.Label03.Visible = False
>
> frm1.Panel04.Visible = False
> frm1.Label04.Visible = False
>
> frm1.Panel05.Visible = False
> frm1.Label05.Visible = False
>
> frm1.Panel06.Visible = False
> frm1.Label06.Visible = False
>
> frm1.Panel07.Visible = False
> frm1.Label07.Visible = False
>
> frm1.Panel08.Visible = False
> frm1.Label08.Visible = False
>
> frm1.Panel09.Visible = False
> frm1.Label09.Visible = False
>
> End Sub
>
> End Module
>
> Then in my Buttons Click Even, I called btn1Click()
>
> and nothing happens. I don't get an error or anything.
>
> I'm thinking I have to declare each panel and label in Module.
>
> TIA
>
> Bob
>


.