|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
custom controls tutorial or guideHi guys,
Is there a guideline of some sort for howto create custom controls? I was thinking I might cut my teeth on a context sensitive combobox that changes background color depending on the selected value. But I just don't know where to start. ![]() regards bruce |
|
|
Re: custom controls tutorial or guideI think for the begginnig you must to do an encapsulating classe.
It's a class that take a control as parameter. And give to it new function or feature. so: ============================================================= CLASS CColourCombo Private $hComboBox Private $hObs as new Observer Public sub _New(hCombo as ComboBox) $hComboBox = hCombo $hOBS=NEW Observer(hCombo) AS "MyCombo" End PUBLIC SUB MyCombo_Change() If $hCombox.Current.Text<0 then $hComboBox.BackColor=Color.Red else $hComboBox.BackColor=Color.White endif end ==================================== 'Form Now in your form just add Public sub _New dim hCColourCombo as CColourCombo hCColourCombo = new CColourCombo(MyComboBox) endif END ====================================== And now you have a combo box that change backcolour when the selected value is negative ! It's more simple than a control if you have no so many feature to add. Fabien 2009/11/8 bbb888 <bbruen@...>: > > Hi guys, > > Is there a guideline of some sort for howto create custom controls? > > I was thinking I might cut my teeth on a context sensitive combobox that > changes background color depending on the selected value. > > But I just don't know where to start. :-(( > > regards > bruce > -- > View this message in context: http://old.nabble.com/custom-controls-tutorial-or-guide-tp26251482p26251482.html > Sent from the gambas-user mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Gambas-user mailing list > Gambas-user@... > https://lists.sourceforge.net/lists/listinfo/gambas-user > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gambas-user mailing list Gambas-user@... https://lists.sourceforge.net/lists/listinfo/gambas-user |
|
|
Re: custom controls tutorial or guide> Hi guys,
> > Is there a guideline of some sort for howto create custom controls? > > I was thinking I might cut my teeth on a context sensitive combobox that > changes background color depending on the selected value. > > But I just don't know where to start. :-(( > > regards > bruce > You can start at http://gambasdoc.org, where you will find a link named "How to program components in Gambas". Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Gambas-user mailing list Gambas-user@... https://lists.sourceforge.net/lists/listinfo/gambas-user |
| Free embeddable forum powered by Nabble | Forum Help |