How do I create/modify a VB .Net object?

This question may be elementary to some of you, which would be great for me.

I would like to add a property to a VB .Net object, or create an object based on a current object.  I'd like to be able to add a property to a panel that changes the bevel; such as raised or inset.  Right now, the only 3D property is inset.  I'd like to be able to programmatically change it from inset to raised and back.  I'm pretty good with VB6, but since VB6 didn't do inheritance very well, it's new to me.  VB6 in Visual Studio 6 Enterprise has a control set called "Sheridan 3D controls," found in the file "Threed32.ocx," which has a panel that does what I want.  But it's not in .Net.

When I worked in Delphi, I only had to search the Internet for a control that would do what I wanted (sites like Torry's Delphi pages or Superpage), so I didn't really need to understand inheritance.  I can't seem to find any similar sites for VB .Net, so I'd like know where I could go to find what I need.  Or could anyone steer me to any type of tutorial for modifying .Net objects?  Or can the Sheridan controls be used in VB .Net (such as adding "Threed32.ocx" to the form object list)?

Many thanks in advance for your help (or condolences)...

Randy
StateGuyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

broadbentCommented:
Generically

Private HasBevel as Boolean

Public Property MyProperty() as Boolean
 Get
  Return HasBevel
 End get
 Set(Byval Value as Boolean)
  HasBevel = Value
  Refresh()
 End Set
End Property

and in the paint event, use hasbevel to darw bevel or whatever
0
broadbentCommented:
Oops.

I assujmed you already had a userControl, or object.
If you have, this simply change
Inherits System.Windows.Forms.UserControl  to Inherits System.Windows.Forms.Panel
0
StateGuyAuthor Commented:
I, too, am pretty much self-taught, which probably explains my dilemma.  I didn't quite understand what you gave me, so I tried this:

Public Class MyPanel
    Inherits System.Windows.Forms.Panel
    Private HasBevel As Boolean

    Public Property Bevel3D() As Boolean
        Get
            Return HasBevel
        End Get
        Set(ByVal Value As Boolean)
            HasBevel = Value
            Refresh()
        End Set
    End Property

End Class

It successfully saved and compiled, which really confuses me.  The panel name is "Panel1" (VB .Net default name) and I need the bevel to change in the "Panel1_Click" event.  

If this is right, how do I use it?  If this is wrong (which I assume is the case), how do I fix it?  

BTW, thanks for the quick response.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

broadbentCommented:
So you want to change the border of a panel?
In which case why not simply change its borderstyle.
If you want to click on the panel to do this then all you need do is add the following code in the Panel_Click event
Select case panel1.borderstyle
case borderstyle.fixed3d: panel1.borderstyle=borderstyle.none
etc..
You don't need to create your own panel with a special property.
0
StateGuyAuthor Commented:
No, I wanted to change the inset/raised bevel, not the border.  Anyway, what I ended up doing was first, I found the System32\Threed32.ocx file and referenced it: References - Threed
Second, added the right "Imports" statement: "Imports Microsoft.VisualBasic"
Third, Right clicked on the "Windows Forms" tab and selected the controls I needed from the COM list.

It was a wild hunch, but I figured I had nothing to lose.  There wasn't really a direct answer, but you made me think in a different direction.  As far as I'm concerned, you've earned the points.  I don't know how to award them without a definitive answer, but you get the 500 points for the help.  Thanks for the push in the right direction.

Randy
0
broadbentCommented:
A word of warning. As I recall, Threed32.ocx is old tochnology.
If you want to have a bevel (not a border) then paint it on.
In VS, GDI+ now encapsulates all those Windows APIs used for drawing, and you might as well learn how to use them.

I suggest using a panel, because it has fewer overheads. using Inherits.
paint the bevel in the paint event using
Dim g as graphics = e.graphics ( e is an argument in the paint event)
Then use either a solidbrush or hatch brush to paint the bevels

Then in the MouseEnter, MouseLeave, MouseDown events
set the colour, size, show (whatever) global variables and then Refresh()
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.