Inserting Code ina subclassed control


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have setup a  Base Calss library and included a few of the SF controls, got them into a DLL and got them onto the toolbox...so far so good. I now want to put a bit of code into two of them specifically. I realise this is more of a .net thing rather than SF ,but any help would be appreciated. If I can get one or two examples to start me off it would be a great help.

On the DateBox, I want to set the default local to British (or whatever does a DD/MM/YYYY rather than MM/DD/YYYY)

On a textBox, I want to set a BackGround Colour when the control gets focus. This we have on VFP and it is very useful, particulalrly on a form with many controls, to give the user a visual clue as to where they are at.

(I am of the impression that there is now 'Visual' way to change a property in .net but maybe someone could confirm this)

public class DateBox : MicroFour.StrataFrame.UI.Windows.Forms.DateBox
{//  Code here to change  Date format to british }


public class Textbox : MicroFour.StrataFrame.UI.Windows.Forms.Textbox
{// VFP equivalent --> when enabled this.BackGroundColour = Rgb(255,0,0)}


Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Is there a VFP equivalent to RGB()




Yes. You will use the Color.FromArgb(A, R, G, B). This allows you to specify an alpha channel as well (opacity). But you can omit it if you need to and just supply the RGB values:



//-- This will be red and will assume full opacity

Color myColor = Color.FromArgb(255,0,0);



//-- This will be red and will set the opacity to roughly half

Color myColor = Color.FromArgb(128, 255,0,0);

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search