[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

my own user control shape

Posted on 2002-03-28
4
Medium Priority
?
171 Views
Last Modified: 2011-09-20
Hi,

when i create my user control, i draw it using shape control. Then it looks FLAT, but I want it to be 3D or looks like the command button .
How can i do it
0
Comment
Question by:toni2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 200 total points
ID: 6903877
Hi, again!
3D effects are achieved by adding gradiations of brightnesses.

If you look at a typical 3D button, you'll notice that the "surface" of the button is medium/light gray, the top and left are off-white, and the bottom and right are off-black.

There are several ways to achieve this:

1) Create a series of overlapping shapes, slightly offset from each other.  For example, create a series of light oval slightly up and left from the desired oval surface, then create a series of dark ovals slightly down and right, then place the primary oval at the correct location (with ZOrder = vbBringToFront.)

2) Actually draw arcs of various lengths and colors at various points to give the appearance of depth.  (This can be done using the Circle command onto the user control surface.)

I'll try to work out some details in the next comment.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6903925
OK, try something like this (assumes that your oval is twice as wide as it is high, i.e. width/height=.5) put into your user control's paint event.

  Dim sglRadiusX As Single
  Dim sglRadiusY As Single
  Dim iOffset As Integer
 
  Const PI As Double = 3.14159265358979
 
  sglRadiusX = Shape1.Width / 2
  sglRadiusY = Shape1.Height / 2
 
  For iOffset = 0 To 25 Step 5
    Me.Circle (Shape1.Left + sglRadiusX + iOffset, Shape1.Top + sglRadiusY + iOffset), sglRadiusX, &H606060, 225 * PI / 180, 45 * PI / 180, 0.5
    Me.Circle (Shape1.Left + sglRadiusX - iOffset, Shape1.Top + sglRadiusY - iOffset), sglRadiusX, &HF0F0F0, 45 * PI / 180, 225 * PI / 180, 0.5
  Next iOffset
 
0
 

Author Comment

by:toni2002
ID: 6907545
Hi rspahitz,

Thanx a lot for your interest and sorry for being late.
Both answers are right but I used the first one in my project.

Best wishes
Toni2002
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6910412
I'm glad it was helpful! :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question