Click here to Skip to main content
15,895,537 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralSoap serialization Pin
Gerosa11-Nov-02 6:00
Gerosa11-Nov-02 6:00 
GeneralPassword Encryption Pin
Derek Lakin11-Nov-02 3:41
Derek Lakin11-Nov-02 3:41 
GeneralRe: Password Encryption Pin
Daniel Turini11-Nov-02 3:47
Daniel Turini11-Nov-02 3:47 
GeneralRe: Password Encryption Pin
Furty13-Nov-02 16:07
Furty13-Nov-02 16:07 
QuestionSubclassing? Pin
Stan Shannon11-Nov-02 2:19
Stan Shannon11-Nov-02 2:19 
AnswerRe: Subclassing? Pin
James T. Johnson11-Nov-02 3:11
James T. Johnson11-Nov-02 3:11 
GeneralRe: Subclassing? Pin
Stan Shannon11-Nov-02 3:45
Stan Shannon11-Nov-02 3:45 
GeneralRe: Subclassing? Pin
Paul Watson11-Nov-02 4:00
sitebuilderPaul Watson11-Nov-02 4:00 
Stan Shannon wrote:
The form still owns the control and defines it's behavior. So, for example, even if I override the TextBox's OnPaint method and attempt to use the Graphics object to draw in the client area of the text box - the form's default behavior still overrides what I want the control to do.

(I may not understand your situation right so this may not be what you are asking)

Then you need to override the Paint member inside your inhereted control.

e.g. In my CP+ app I did the following to provide a underlined look on DataGrid cells (this is C# but should be easy enough for other languages):

First I inhereted the DataGridTextBoxColumn (subclass I assume):
public class DataGridLinkColumn : DataGridTextBoxColumn


then I overrode the Paint event:
protected override void Paint(Graphics g,Rectangle Bounds,CurrencyManager Source,int RowNum, Brush BackBrush ,Brush ForeBrush ,bool AlignToRight)
{
    g.FillRectangle(BackBrush, Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height);
    FontStyle fstylNew = new FontStyle();
    fstylNew = FontStyle.Underline;
    System.Drawing.Font font = new Font(System.Drawing.FontFamily.GenericSansSerif , (float)8.25, fstylNew);
    g.DrawString( GetColumnValueAtRow(Source, RowNum).ToString(), font ,Brushes.Blue ,Bounds.X ,Bounds.Y );
}



Is that what you are looking for?

Paul Watson
Bluegrass
Cape Town, South Africa

Ray Cassick wrote:
Well I am not female, not gay and I am not Paul Watson
GeneralRe: Subclassing? Pin
Stan Shannon12-Nov-02 0:48
Stan Shannon12-Nov-02 0:48 
GeneralRe: Subclassing? Pin
Martin Haesemeyer13-Nov-02 6:49
Martin Haesemeyer13-Nov-02 6:49 
GeneralRe: Subclassing? Pin
Stan Shannon13-Nov-02 7:08
Stan Shannon13-Nov-02 7:08 
QuestionHow do I catch ListView's scrolling? Pin
8-Nov-02 2:01
suss8-Nov-02 2:01 
AnswerRe: How do I catch ListView's scrolling? Pin
Stan Shannon11-Nov-02 2:24
Stan Shannon11-Nov-02 2:24 
GeneralRe: How do I catch ListView's scrolling Pin
ikinari11-Nov-02 13:46
ikinari11-Nov-02 13:46 
GeneralWeb Service Session State Pin
Code for Food7-Nov-02 12:15
Code for Food7-Nov-02 12:15 
QuestionHow to set form to maximum form... Pin
Munti7-Nov-02 11:43
Munti7-Nov-02 11:43 
AnswerRe: How to set form to maximum form... Pin
Paul Watson7-Nov-02 11:53
sitebuilderPaul Watson7-Nov-02 11:53 
GeneralRe: How to set form to maximum form... Pin
Munti7-Nov-02 12:14
Munti7-Nov-02 12:14 
GeneralProblem with .NET and W2K Pin
Marc Clifton7-Nov-02 11:00
mvaMarc Clifton7-Nov-02 11:00 
GeneralRe: Problem with .NET and W2K Pin
Sijin12-Nov-02 1:59
Sijin12-Nov-02 1:59 
GeneralSerializing an Exception object Pin
solidstore7-Nov-02 7:11
solidstore7-Nov-02 7:11 
GeneralGDI+ vs DirectX Pin
SimonS6-Nov-02 22:19
SimonS6-Nov-02 22:19 
GeneralRe: GDI+ vs DirectX Pin
Christian Graus6-Nov-02 22:23
protectorChristian Graus6-Nov-02 22:23 
GeneralInstallation tool Pin
Patrick Lassalle6-Nov-02 10:25
Patrick Lassalle6-Nov-02 10:25 
GeneralRe: Installation tool Pin
Heath Stewart6-Nov-02 19:43
protectorHeath Stewart6-Nov-02 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.