473,385 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Are OwnerDraw button supported in CSharp

Hi All,

Are ownerdraw buttons supported in C# ?

I have an active X control which I would like to use in CSharp.

Buttons have a style BS_OWNERDRAW, and to do custom drawing you have
to handle WM_DRAWITEM message. It works greate in all languages except
CSharp and VB.net.

As soon as I change the style of the window (by chanding a property of
the Active X control) to BS_OWNERDRAW, it crashes with a NULL pointer
exception.

Any ideas?

Thanks in advance

Anand
Nov 15 '05 #1
2 2943
Anand,

I recently read an article that might relate to your problem. It has
CCoolButon Class that is a OwnerDraw Button
http://www.codeguru.com/printing/gen...nt_class.shtml

I hope this helps.

Thanks,

J
--------------------
From: th************@yahoo.com (anand)
Newsgroups: microsoft.public.dotnet.languages.csharp
Subject: Are OwnerDraw button supported in CSharp
Date: 28 Jan 2004 20:42:08 -0800
Organization: http://groups.google.com
Lines: 19
Message-ID: <f9************************@posting.google.com>
NNTP-Posting-Host: 130.164.143.42
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1075351328 30330 127.0.0.1 (29 Jan 2004 04:42:08 GMT)X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Thu, 29 Jan 2004 04:42:08 +0000 (UTC)
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!newsfeed.gamma.ru!Gamma.RU!colt.net!news .maxwell.s
yr.edu!postnews1.google.com!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.csharp:216232
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Hi All,

Are ownerdraw buttons supported in C# ?

I have an active X control which I would like to use in CSharp.

Buttons have a style BS_OWNERDRAW, and to do custom drawing you have
to handle WM_DRAWITEM message. It works greate in all languages except
CSharp and VB.net.

As soon as I change the style of the window (by chanding a property of
the Active X control) to BS_OWNERDRAW, it crashes with a NULL pointer
exception.

Any ideas?

Thanks in advance

Anand


Nov 15 '05 #2
Anand,

I recently read an article that might relate to your problem. It has
CCoolButon Class that is a OwnerDraw Button
http://www.codeguru.com/printing/gen...nt_class.shtml

I hope this helps.

Thanks,

J
--------------------
From: th************@yahoo.com (anand)
Newsgroups: microsoft.public.dotnet.languages.csharp
Subject: Are OwnerDraw button supported in CSharp
Date: 28 Jan 2004 20:42:08 -0800
Organization: http://groups.google.com
Lines: 19
Message-ID: <f9************************@posting.google.com>
NNTP-Posting-Host: 130.164.143.42
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1075351328 30330 127.0.0.1 (29 Jan 2004 04:42:08 GMT)X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Thu, 29 Jan 2004 04:42:08 +0000 (UTC)
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!newsfeed.gamma.ru!Gamma.RU!colt.net!news .maxwell.s
yr.edu!postnews1.google.com!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.csharp:216232
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Hi All,

Are ownerdraw buttons supported in C# ?

I have an active X control which I would like to use in CSharp.

Buttons have a style BS_OWNERDRAW, and to do custom drawing you have
to handle WM_DRAWITEM message. It works greate in all languages except
CSharp and VB.net.

As soon as I change the style of the window (by chanding a property of
the Active X control) to BS_OWNERDRAW, it crashes with a NULL pointer
exception.

Any ideas?

Thanks in advance

Anand


Nov 15 '05 #3

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

Similar topics

3
by: Thomas Kehl | last post by:
Hi. Does anybody have a sample, how does I can make a checkBox ownerdrawn? I need to change the color inside of the box. Can anyone help me, how does I have to do this? Thanks Thomas
0
by: Apollo440 | last post by:
If MenuItem.OwnerDraw Property is true,.NET framework does not recognize the overlapped accelerator keys. Is there a workaround? eg) +------+ |&Test | <- |&Tea | <- MenuItems has...
2
by: Stuart Norris | last post by:
Dear Group, I am new to c# and windows form designer - coming from a Motif background. I am attempting to develop an application for a touch screen and I need to have a menu system with a...
6
by: Celine | last post by:
This question might be very trivial but how can I check that a button is clicked. Is there a way to do something like: if(button is clicked) { .... } Thanks Celine
2
by: jm | last post by:
There are properties for OwnerDraw on ContextMenu items. I know it can be done with regular menus. I cannot find anyone doing it with the systray icon contextmenu (notifyicon.) Is it possible to...
0
by: Michel | last post by:
I come back with a new question regarding my OwnerDraw menu. That is a classical ownerDraw menu to add icon and some other color properties. My feature is to color all the menu bar with the...
2
by: Peter Proost | last post by:
Hi group, I've got this ownerdraw menu module which I got from a site and modified to my personal needs, but the only problem I'm having is with the lines in a menu, when you type - as text, it...
0
by: genojoe | last post by:
This code is derived from: ms-help://MS.VSCC.2003/MS.MSDNQTR.2005JUL.1033/cpref/html/frlrfSystemWindowsFormsMenuItemClassOwnerDrawTopic.htm The sample works as presented but does not contain a...
1
by: tmda | last post by:
I'm using OwnerDraw for some customization in my ListView - adding color to item backgrounds. I'm using the ListView specifically for it's OwnerDraw capability. I originally was using the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.