Wrox Programmer Forums
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2005, 11:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

It was nice talking to you Nalaka.

Based on our discussion, I think I have found at-least one way of solving your problem.
Well there must be some way thru reflection as well, but being a follower of OOPs
Philosophies, I think if you just define an interface with the said function, and base all
your child forms on it, you will get the solution to your problem

Just define an interface which would look something like

Interface IMyBase
    Sub Perform_ButtonClick(ByVal Button As String)
End Interface

implement this interface in all your child form classes like this

Public Class Form2
    Inherits System.Windows.Forms.Form
    Implements IMyBase

.
.
.

    Public Sub Perform_ButtonClick(ByVal Button As String) Implements IMyBase.Perform_ButtonClick
        MsgBox("FORM II")
    End Sub

then change you MdiParent CType.... stetement to this

CType(Me.ActiveMdiChild, IMyBase).Perform_ButtonClick("NEW")


Regards
Ankur Verma
 
Old December 16th, 2005, 12:05 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


Hi Ankur,

Thank you very much. It's working.:)
Nice to hear that you are a follower of OOPs because that's what I'm trying to do but I don't have a good knowledge about interface pholimorphism.:(

I would be pleased if you can explain me how interface polimorphism works here in this solution and how do we solve this kind of a problem through reflection..

Thank you again.




 
Old December 18th, 2005, 10:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Well Nalaka, u may notice that this forum has a section called “Browse Books” where you can find some really good books with material on application and practical knowledge of OOPs concepts.

Polymorphism is one of the core concepts you learn under OOPs. And I would suggest that you should get a good book on it if you really wanna learn it. It’s always better that way than trying to learn it from some guy who you met at a forum. :)

Regards
Ankur Verma
 
Old December 18th, 2005, 10:50 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to nalla Send a message via Yahoo to nalla
Default


Hi Ankur,

ThanX for your help. I really appreciate. Your posts really helped to improve my knowledge and skills.
:)
nalla





Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveForm in Mobile Web Form japie ASP.NET 1.0 and 1.1 Professional 0 November 2nd, 2005 02:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.