首页 > 解决方案 > User Control Form (Wizard panel) to have common ShowData() function

问题描述

Like many, I'm trying to build a wizard like presentation.

I've created a Windows Form as the host for a series of "WizPanel"s that have been designed as User Control Forms. Each of them may/will have unique data connections and layouts. My intended implementation creates a Collection(of UserControl). I'm at the design point that I want to load the collection with a set of panels that best describe the process flow required by the current use case.

The problem I'm running into is how to be able to load a New UCDataReview (user control form), a New UCDataParameters (user control form), then the rest of the panels as required. I don't want the panels to load data at this point as some of the data queries may never be required - based on data supplied in previous panels (possibly, just design at this point). I just want to make sure data only loads when I specify. I like to have a function ShowData() on each of the panels and then execute it from within the main Wizard form (after the next button is clicked - it wouldn't be needed on a back as it should be there already).

So, I'm stuck on the concept of crating a 'base wizard panel' control (WizPanelBase) that has a ShowData() function that is empty in the base control form but can be overridden in the class (WizPanel) that the panel is based upon. I'd then have a Collection(of WizPanelBase) that would then allow me to issue a ShowData() call.

I'm sorry for not using the correct verbiage as I'm only a part timer and just playing to learn. I've done this with an Object Class (ObjBase_Person; ObjBase_Vehicle ...) and then extended them into Person_Student, Person_Instructor, Vehicle_Car, Vehicle_Truck etc). I'm quite sure I can, I just know enough to be dangerous, but I don't know what to even ask for to find tutorials. The similar questions here are generally about using a User Control on a Windows form.

标签: vb.netwinformsinheritancewizard

解决方案


推荐阅读