Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

I doubt there's an easy way to setting the style on another program, even with reflection. What is it you need to do, anyway? Why do you need to set a style on another app?

 

In order to set the style, you will need to retrieve the Windows.Forms.Form object representation of the window, and as far as I know, there's no way to get a Form object out of an hWnd.

Posted

ok ive been thinking about this and how i would do it and i realized, i can get the forms object... let me explain a little more in depth what im trying todo.

 

I am making a component for a program called Dashboard.. kind of like the msn sidebar or the sidebar some of you may have seen in screenshots of longhorn. Anyway at the moment Dashboard keeps flashing, and so do the components. I fixed the flashing for my components by setting UserPaint, AllPaintinginWm and the DoubleBuffer styles. Now dashboard only flashes itself which is still anoying so i want to try and set those styles from a component.

 

I can get Dashboard's form object by using Me.Parent from my usercontrol.

 

 

 

Dan

Posted

That doesnt work :( i get this error:

 

'System.Windows.Forms.Control.Protected Sub SetStyle(flag As System.Windows.Forms.ControlStyles, value As Boolean)' is not accessible in this context because it is 'Protected'.

 

Looks like its not going to work this way?

 

 

Dan

 

EDIT: what does DirectCast do?

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...