A noob with a question...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: A noob with a question...

  1. #1
    Join Date
    May 2005
    Posts
    3

    A noob with a question...

    Hi iam well not the best programmer in the world...
    But here go's:
    I was wondering i just made a nice gradient in my main form...
    but now i would like to do the same with the text boxe's,labels, buttons or any thing else i put on the form...
    How do i go around doing that?

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    probably you created the gradient in the form Paint event. You can do the same for any controls that exposes that event (not many, I think only the PictureBox...) For Labels, you can set them as transparent, so they are see-through. In the buttons, you can create a gradient bitmap, and assign it to the Picture property of the buttons.
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  3. #3
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    If you re-create a gradient on a control, the fade will be different as the width/height is spans will be less. Therefore, as Marco suggests, use the transparent property.

  4. #4
    Join Date
    May 2005
    Posts
    3
    I want to thank u,
    but still i dont seem to get the result i wanted...
    i even tryed with api function
    SetWindowLong Text1.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT

  5. #5
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    The transparency can be set only when the window is created, it cannot be changed later with SetWindowLong.
    Keep this in mind: VB and its controls are easy to use, but we pay a price for that: there is a lot that cannot be changed. Usually programmers that creates new 'looks' either make their own usercontrols to replace the existing ones, or sublass them and override the WM_PAINT event. Either way, a lot of work.
    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center