Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi

 

I've created my own toolbar bar control by inheriting the Windows.Forms.Toolbar control to perform some OnPaint() drawing (having set the SetStyle to UserPaint).

 

However when I add the control to a form and programmatically add buttons they appear invisible - although respond to mouse clicks. If I turn off the UserPaint SetStyle they reappear.

 

Does anyone know what I'm missing here? Pointers much appreciated,

David.

 

:confused:

Posted
There is a ".Visible" property on the toolbar buttons, you should set this to visible when you add them programmatically, you probably have the default set to not visible.
Hamlet
Posted

That was also one of my first thoughts, sadly not so simple. :mad:

 

I suspect that it is something to do with the owner drawing I'm performing is preventing the toolbar from painting the buttons, despite calling the base class paint event.

 

Judging by the low number of replies to this post, everyone simply buys a third party tool?

Posted

I'm not using it as a toolbar. I'm using it as a taskbar, al-la SAS DMS (for those who know what that is) I'm writing an add-in to replicate the DMS in SAS Enterprise Guide.

 

The toolbar control is the nearest control to the taskbar but with a little owner drawing was the perfect thing.

:cool:

Posted

I checked out what you want to do...

I overrided ToolBar.OnPaint (or something like that) and tried it out without anything in that sub... nothing bad happened (buttons where visible).

The weird thing is that when i typed mybase.onpaint the list that comes out after the dot (.) did not have that method in it but the compiler did not complain about it either (like underlining it or not building the project)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...