Results 1 to 5 of 5

Thread: Transparent Textbox and some other things !!!

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    63

    Transparent Textbox and some other things !!!

    Hi all,
    I am new here and i am new in VB.net programming.
    I just start with making one new program with really special design (because i am web designer) and i use Border style: None on my FORM and I using one image in background (my design of form). So my first problem is that my BACKGROUND image have sphere shapes on some places and when i making design in PhotoShop i save every image to .png but i have problem. Edges of that sphere parts are really pixelized and work look really bad... So my first question is:
    1.) What is best TransparencyKey color for my FORM ??? (When I making image I saving it as PNG and my background of image is transparent)
    If PNG is not good way please could someone tell me which is best ???

    My sec. problem is that I need transparent Textboxes (and some other controls but for now Textboxes)...
    So i try with some thing what i find on google but nothing is not really good at all. Best result i get with "Alpha text box" Class what i find on CodeGuru, but really bad quality of text and some options (like Read Only) dont work...
    So...

    2.) What is best way for transparent TextBoxes in VB.net (i need to see my FORM Background image through textbox) ???


    Sry for my bad English...

    Thanks in advice,
    Stefan

  2. #2

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    63

    Re: Transparent Textbox and some other things !!!

    Any idea ??? I really need it quick

  3. #3
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Transparent Textbox and some other things !!!

    I can tell you how to set the transparency for the textbox, but the rest you will have to do yourself.
    Code:
    Public Class TextBoxEx
        Inherits TextBox
    
        Public Sub New()
            MyBase.New()
    
            SetStyle(ControlStyles.UserPaint, True)
            SetStyle(ControlStyles.SupportsTransparentBackColor, True)
            
            Me.BackColor = Color.Transparent
        End Sub
    End Class
    But when you set the UserPaint control style, you would need to handled the graphics yourself. Otherwise it would start acting weirdly. You can override the OnPaint etc. methods to make it work correctly. But I'm not sure how exactly to do that (I'm really bad at graphics, so maybe someone else would be able to help you out with that.)
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    63

    Re: Transparent Textbox and some other things !!!

    I find this...
    LINK
    But when I using RichTextbox it is really bad (no refreshing), but when I using textbox it is good but have some big BUG-s (like incorrect cursor position, cursor is showing in reallyonly textbox...etc...)
    Can anybody correct this or give me good link for DLL with best RichTextBox Transparent integration ???
    (I trying to find it now )
    Thanks in advice
    and Thanks Pradeep

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2010
    Posts
    63

    Re: Transparent Textbox and some other things !!!

    Anybody please ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width