Link to home
Start Free TrialLog in
Avatar of Amitava_Mukherjee
Amitava_MukherjeeFlag for India

asked on

Shadow effect in vb.net text box

how to drop shadow of textbox in vb.net?
Avatar of kmt333
kmt333
Flag of United States of America image

Bring up the properties (Alt + Enter) and find the format tab.  Look at "Special Effect" and changed from shadowed to what you want.
Avatar of Amitava_Mukherjee

ASKER

there are no "Special Effect" properties for textbox!!! i am using visual studio .net 2008 express edition, and vb.net 2008 as my development language.
ah, sorry.  Properties, Border Style, change from Fixed3D to none or FixedSingle.  Is that the effect you're talking about?
no no !!! i am using the following code to drop shadow for my form, which is again thanx to EE, who has helped me to do that. now i want to use that type of effect in a text box in my form. is it possible?
Inherits System.Windows.Forms.Form
 
    'Define the CS_DROPSHADOW constant
    Private Const CS_DROPSHADOW As Integer = 131072
 
    ' Override the CreateParams property
    Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
        Get
            Dim cp As CreateParams = MyBase.CreateParams
            ' Check OS Before using XP drop shadow
            Dim OSVer As Version = System.Environment.OSVersion.Version()
            Select Case OSVer.Major
                Case Is < 5
                Case 5
                    If OSVer.Minor > 0 Then
                        cp.ClassStyle = cp.ClassStyle Or CS_DROPSHADOW
                    End If
                Case Is > 5
                    cp.ClassStyle = cp.ClassStyle Or CS_DROPSHADOW
                Case Else
            End Select
            Return cp
 
        End Get
    End Property

Open in new window

ah, that kind of drop shadow!  sorry.  i was on the wrong track there.  absolutely, you can shadow anything.  i typically create a css class and go that route, but there may be an easier way that another expert can an enlighten us both to!
i am working on winform, not a web based application
Avatar of Nasir Razzaq
You have to inherit the textbox and override the createparams property. Then you can use the same code you are using for the form to modify the createparams property. Use the inherited control instead of standard textbox.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx
I fail to understand why it was a B grade answer? I directed you to the resource which would solve your problem. There was no need for an example here. If giving this answer a B grade benefited you in anyway then its understandable.