473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get/ override usercontrol methods.

Hello All
I am a newbie in VB.NET and wanting to create a toolbar(User Control) for Database Navigation. What exactly I want is to have a user control which is inherited from the system.windows. forms. usercontrol and contain a toolbar which have buttons for navigating records. And the client Windows Form which owns that control must overrides the navigation methods of user control. Forexample to add some custom functionality for moving to first record.
Kind Regards
Syed Zaidi

From http://www.developmentnow.com/g/38_2...nguages-vb.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Nov 21 '05 #1
2 2783
I would do something like the following (syntax is not guaranteed perfect):

On you UserControl, drop four buttons, lay them out how you want, and name
one btnFirst, btnPrev, btnNext, and btnLast.

Then in the code behind code as follows (Designer generated code left out):

Public Class MyNavControl
Inherits UserControl

Public Enum MovementStep
First
Previous
Next
Last
End Enum

Public Event Navigate(WhichW ay As MovementStep)

Public Sub btnClick(sender As Object, e As EventArgs) _
Handles btnFirst.Click, btnPrev.Click, btnNext.Click, btnLast.Click
If sender Is btnFirst Then
RaiseEvent Navigate(Moveme ntStep.First)

ElseIf sender Is btnPrev Then
RaiseEvent Navigate(Moveme ntStep.Previous )

ElseIf sender Is btnNext Then
RaiseEvent Navigate(Moveme ntStep.Next)

ElseIf sender Is btnLast Then
RaiseEvent Navigate(Moveme ntStep.Last)

End If
End Sub
End Class
"Syed Zaidi" <hy**********@y ahoo.co.uk> wrote in message
news:e2******** *************** ***********@msn ews.microsoft.c om...
Hello All
I am a newbie in VB.NET and wanting to create a toolbar(User
Control) for Database Navigation. What exactly I want is to have a user
control which is inherited from the system.windows. forms. usercontrol and
contain a toolbar which have buttons for navigating records. And the
client Windows Form which owns that control must overrides the navigation
methods of user control. Forexample to add some custom functionality for
moving to first record.
Kind Regards
Syed Zaidi

From
http://www.developmentnow.com/g/38_2...nguages-vb.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com

Nov 21 '05 #2
Arthur,

Nice

Cor
Nov 21 '05 #3

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

Similar topics

3
334
by: Tee | last post by:
Hi, I have a usercontrol with a overridable/virtual method. On the usercontrol onload, it will call this method. Now I have a form that have a few of this usercontrol. And I want to override the method in each usercontrol, how do I accomplish this?
14
12129
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using events since I never saw it used anywhere in MSDN documentation/samples?! Or it will just break when I upgrade to .NET Framework 2.x in the coming years namespace MyNamespac public delegate void MyDel() public class MyBase public virtual...
1
4927
by: Tiago Barbutti | last post by:
I have a UserControl that execute methods in Load event, but it hapens in designMode and generate an error and the control disappear from the form. I read that i can use the DesignMode to kwnow when my control is in design or Runtime mode, it´s work, but when this usercontrol is put in another usercontrol the DesignMode property always return false. How can I do to stop the methods to execute in designMode when my usercontrol is in...
15
2545
by: John Salerno | last post by:
Hi all. I have a question about virtual and override methods. Please forgive the elementary nature! First off, let me quote Programming in the Key of C#: "Any virtual method overridden with 'override' remains a virtual method for further descendent classes." Now here's my question: Let's say you have base class A, and subclasses B and C. Class A contains a virtual method, and B contains an override method. If C didn't have an...
0
1401
by: Syed Zaidi via .NET 247 | last post by:
How to get a custom toolbar buttons on vb.net winform and how to override it. Suppose we put a toolbar on usercontrol. And want to code or enhance the functionality of the buttons or in simple want to override that usercontrol toolbar button on client windows forms who uses or inherits that user contorl. -------------------------------- From: Syed Zaidi ----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/) ...
2
2124
by: DraguVaso | last post by:
Hi, I have a UserControl (MyUserControl) which has a DataGrid (MyDataGrid). I made a new UserControl that Inherits of my first UserControl: I named it MyInheritedUserControl. For some reason I don't 'see' the Methods/Events etc of the Controls I putted on MyUserControl in the two ComboBoxes on top of the Code Window in Visual Studio. I can use the Methods and Events, but I have to type them mysels. For example I can trap the event...
0
1457
by: Syed Zaidi via .NET 247 | last post by:
I am working on a small project in which i want to develop acustom toolbar skeleton for handling database navigation. I havecreated a usercontrol consist of a toolbar inherits fromusercontrol and winform holding that control. First I want toaccess the Click functionality of each toolbar button(usercontrol) in my winform which holding the usercontrol; secondlywants to override the methods of usercontrol in winformaccordingly to the click event of...
5
1639
by: Dom | last post by:
I have a usercontrol, and I am trying to write a Property called "Text", but the compiler tells me that the Usercontrol class already has a member called "Text". When I look (in intellisense, or help) I don't see the member. I can easily override or make it new, but I'd like to know what is going on. Dom
1
3110
by: Joshua | last post by:
I'm creating a web control that has an image and a text box. I would like to then override the Visible and Text property of the usercontrol, so when you reference the visible property of the user control it only set the visible property of the textbox. When i call these newly created property I get the following error: Object reference not set to an instance of an object. Does anybody have any idea? Thank you.
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9027
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7725
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4369
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.