473,494 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

really daring subject! DataGrid MyBase.OnPaint -> content

Hi,

I want to override the MyBase.OnPaint(ByVal pe As
System.Windows.Forms.PaintEventArgs) of the DataGrid, to have some custom
property's designed (other column headers etc).

The problem is that I don't know the content of the original MyBase.OnPaint,
so I don't know what I need to put in my overriden Sub. does anybody knows
the content of it? Or is there a way to figure it out? Maybe somewhere in
the pe-argument?

Any help would be really appreciated!

thanks a lot,

Pieter Coucke
Jul 22 '05 #1
8 1521
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP14.phx.gbl...
I want to override the MyBase.OnPaint() of the DataGrid, .. . . The problem is that I don't know the content of the original
MyBase.OnPaint, so I don't know what I need to put in my overriden Sub.
.. . . is there a way to figure it out?


1. Override OnPaint with a routine containing no code at all.
2. Run your application.

The base method did whatever /doesn't/ happen any more ;-))

HTH (but doubt it),
Phill W.
Jul 22 '05 #2
Hehehe thanks, I tried that alreaddy before, and it was like that that I
figured out Ireally needed the orignal code in it, hehe :-)

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:da**********@yarrow.open.ac.uk...
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP14.phx.gbl...
I want to override the MyBase.OnPaint() of the DataGrid,

. . .
The problem is that I don't know the content of the original
MyBase.OnPaint, so I don't know what I need to put in my

overriden Sub.
. . .
is there a way to figure it out?


1. Override OnPaint with a routine containing no code at all.
2. Run your application.

The base method did whatever /doesn't/ happen any more ;-))

HTH (but doubt it),
Phill W.

Jul 22 '05 #3
Download Reflector and take a look at it yourself. It will show the
code in VB, C# or Delphi!

Jul 22 '05 #4
Wow that's just a great tool!!!!!
Thanks a lot!!! :-)
"Chris Dunaway" <du******@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Download Reflector and take a look at it yourself. It will show the
code in VB, C# or Delphi!

Jul 22 '05 #5
Hm wel ok, it's really nice, but I'm afraid it won't help me doing what I
want to do :-/ It uses functions that are private declared in the datagrid,
so I can't use them in my inherited datagrid. Anybody has a solution?

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:u4*************@TK2MSFTNGP14.phx.gbl...
Wow that's just a great tool!!!!!
Thanks a lot!!! :-)
"Chris Dunaway" <du******@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Download Reflector and take a look at it yourself. It will show the
code in VB, C# or Delphi!


Jul 22 '05 #6
On Thu, 7 Jul 2005 09:19:19 +0200, DraguVaso wrote:
Hm wel ok, it's really nice, but I'm afraid it won't help me doing what I
want to do :-/ It uses functions that are private declared in the datagrid,
so I can't use them in my inherited datagrid. Anybody has a solution?


There's nothing preventing you from calling Mybase.OnPaint yourself:

Protected Overrides Sub OnPaint( _
ByVal pe As System.Windows.Forms.PaintEventArgs)

' call the parent
MyBase.OnPaint(pe)

' now do some more stuff

End Sub
Jul 22 '05 #7
I did it already like that, but the problem is that it's really not a nice
solution: It draws the 'normal' column headers each time, and after half a
second it draws my custom column headers. This happens each time the grid is
refreshed or when there is clicked on the column-headers...

Isn't there a way to prevent things ike that? For instance some function
that repaints the control in memory, and shows it when everything is
complete (and my custom column headers are already put before the
original)... Isn't there some kind of function like this that tells the
datagrid to wait to do the updates just until it has the permission?

"Ross Presser" <rp******@NOSPAMgmail.com.invalid> wrote in message
news:sw*****************************@40tude.net...
On Thu, 7 Jul 2005 09:19:19 +0200, DraguVaso wrote:
Hm wel ok, it's really nice, but I'm afraid it won't help me doing what I want to do :-/ It uses functions that are private declared in the datagrid, so I can't use them in my inherited datagrid. Anybody has a solution?


There's nothing preventing you from calling Mybase.OnPaint yourself:

Protected Overrides Sub OnPaint( _
ByVal pe As System.Windows.Forms.PaintEventArgs)

' call the parent
MyBase.OnPaint(pe)

' now do some more stuff

End Sub

Jul 22 '05 #8
Yessssssssssssss!!! I found it myself:
I call the base-class and than draw my custom functions in my
OnPaint-override. But this give me some stupid flickering, and always showed
a fraction of a second the old column-heaeders. But by using DoubleBuffer
and AllPaintingInWmPaint this problem is solved!! really great!!!! :-)

Public Sub EnableDoubleBuffering()
' Set the value of the double-buffering style bits to true.
Me.SetStyle(ControlStyles.DoubleBuffer _
Or ControlStyles.UserPaint _
Or ControlStyles.AllPaintingInWmPaint, _
True)
Me.UpdateStyles()
End Sub


"DraguVaso" <pi**********@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP14.phx.gbl...
Hi,

I want to override the MyBase.OnPaint(ByVal pe As
System.Windows.Forms.PaintEventArgs) of the DataGrid, to have some custom
property's designed (other column headers etc).

The problem is that I don't know the content of the original MyBase.OnPaint, so I don't know what I need to put in my overriden Sub. does anybody knows
the content of it? Or is there a way to figure it out? Maybe somewhere in
the pe-argument?

Any help would be really appreciated!

thanks a lot,

Pieter Coucke

Jul 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2401
by: DraguVaso | last post by:
Hi, I have my custom Inherited DataGrid. I override the OnPaint-event to speed up things and avoid flikkering using Double Buffering. To draw the normal things of the DataGrid I have to call the...
8
1011
by: DraguVaso | last post by:
Hi, I want to override the MyBase.OnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs) of the DataGrid, to have some custom property's designed (other column headers etc). The problem is...
0
6989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.