Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to disable base class property? Pin
Paul Riley16-Jan-03 2:14
Paul Riley16-Jan-03 2:14 
GeneralDictionary Class Pin
MStanbrook15-Jan-03 14:11
MStanbrook15-Jan-03 14:11 
GeneralRe: Dictionary Class Pin
leppie15-Jan-03 14:37
leppie15-Jan-03 14:37 
GeneralRe: Dictionary Class Pin
Philip Fitzsimons16-Jan-03 1:42
Philip Fitzsimons16-Jan-03 1:42 
GeneralAccessing/remoting a network PC Pin
vlusardi15-Jan-03 13:37
vlusardi15-Jan-03 13:37 
QuestionCloning a control? Pin
FruitBatInShades15-Jan-03 13:17
FruitBatInShades15-Jan-03 13:17 
AnswerRe: Cloning a control? Pin
leppie15-Jan-03 13:46
leppie15-Jan-03 13:46 
GeneralSubclassing Problems.... Pin
FruitBatInShades15-Jan-03 12:01
FruitBatInShades15-Jan-03 12:01 
Blarggh!

I'm subclassing controls as they are added to a control. All works well apart from when I resize them. They flicker like crazy and redraw (this resize is done following the mouse, so there are many resizes, i.e. adjusting the width to follow the mouse) incorrectly.

If I place controls on before the app runs these controls don't flicker (i.e. they are not subclassed).

The textbox controls draw a border inside themselves (the backcolor shows through where the border is inside the control)
Does anyone have any idea what I'm missing. I'm guessing it's got something to do with WM_PAINT?

Cry | :(( Eek! | :eek: Cry | :(( Eek! | :eek: Cry | :(( Eek! | :eek: Cry | :((
See problem
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Handles _SubClassArray.CallBackProc
    'This procedure handles messages from the child controls
    Select Case m.Msg
        Case WM_LBUTTONDOWN
            'select object
            _ControlAtMouseDown = Control.FromHandle(m.HWnd)
            _MouseDownTick = _TickCount
            _MouseUpTick = -1
            _MouseState = MouseState.LeftDown
            _MouseDownTime = -1
            m = Nothing
        Case WM_LBUTTONUP
            'stop current operation
            _MouseState = MouseState.LeftUp
            _MouseUpTick = _TickCount
            _MouseDownTime = _MouseUpTick - _MouseDownTick
            Me.Cursor = Cursors.Default
            ChangeOperation(Operations.None)
        Case WM_RBUTTONDOWN
            'Show menu
            _MouseState = MouseState.RightDown
        Case WM_MOUSEFIRST          ' Mouse over
            m = Nothing
        Case WM_SETFOCUS, WM_LBUTTONDBLCLK, WM_MOUSEHOVER, WM_MOUSEMOVE, WM_MOUSELEAVE, WM_KEYDOWN, WM_KEYUP
            'Dump these messages to stop the control reacting
            m = Nothing
            'Case WM_PAINT
            '   'redraw control
            '   _ControlToPaint = Control.FromHandle(m.HWnd)
            '   _ControlToPaint.Refresh()
    End Select
    MyBase.WndProc(m)
End Sub

GeneralRe: Subclassing Problems.... Pin
leppie15-Jan-03 13:49
leppie15-Jan-03 13:49 
GeneralRe: Subclassing Problems.... Pin
FruitBatInShades15-Jan-03 23:07
FruitBatInShades15-Jan-03 23:07 
GeneralRe: Subclassing Problems.... Pin
James T. Johnson15-Jan-03 15:07
James T. Johnson15-Jan-03 15:07 
GeneralRe: Subclassing Problems.... Pin
FruitBatInShades16-Jan-03 0:56
FruitBatInShades16-Jan-03 0:56 
GeneralRe: Subclassing Problems.... Pin
FruitBatInShades16-Jan-03 0:53
FruitBatInShades16-Jan-03 0:53 
GeneralDelegate parameter info Pin
leppie15-Jan-03 6:37
leppie15-Jan-03 6:37 
GeneralRe: Delegate parameter info Pin
Richard Deeming15-Jan-03 7:16
mveRichard Deeming15-Jan-03 7:16 
GeneralRe: Delegate parameter info Pin
leppie15-Jan-03 8:15
leppie15-Jan-03 8:15 
GeneralPlease help me(All about loading control in class file) Pin
Gurus Guru15-Jan-03 2:09
Gurus Guru15-Jan-03 2:09 
GeneralRe: Please help me(All about loading control in class file) Pin
James T. Johnson15-Jan-03 15:13
James T. Johnson15-Jan-03 15:13 
GeneralRe: Please help me(All about loading control in class file) Pin
Anonymous15-Jan-03 20:50
Anonymous15-Jan-03 20:50 
GeneralRe: Please help me(All about loading control in class file) Pin
Vasudevan Deepak Kumar15-Jan-03 23:08
Vasudevan Deepak Kumar15-Jan-03 23:08 
GeneralRe: Please help me(All about loading control in class file) Pin
Gurus Guru17-Jan-03 6:02
Gurus Guru17-Jan-03 6:02 
Generalknow the apps a user/machine ran Pin
Giovanni Bejarasco15-Jan-03 1:30
Giovanni Bejarasco15-Jan-03 1:30 
GeneralRe: know the apps a user/machine ran Pin
Mazdak15-Jan-03 6:06
Mazdak15-Jan-03 6:06 
GeneralCalling .NET object from COM Pin
SimonS14-Jan-03 22:10
SimonS14-Jan-03 22:10 
GeneralRe: Calling .NET object from COM Pin
Daniel Turini14-Jan-03 22:17
Daniel Turini14-Jan-03 22:17 

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.