Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
Image stretch or reduced to fit inside button in VB.NET
Old 10-22-2008, 04:16 PM Image stretch or reduced to fit inside button in VB.NET
Experienced Talker

Posts: 35
Name: remya
Trades: 0
i'm using VB.Net Application program.
i'm creating 64 button dynamically during run time. and from database i'm getting the description, font color, back color and picture path. and if the picture path is not nothing, then i need to display that picture in that button. if picture path is nothing, then need to display the description as button text using font color and back color.
this button values are not loaded only once. using button click Addhandler, each button values keeps on changing each time.

The Code i used to display is
Code:
       For Each c As Control In Controls
            If c.Name = "ItemBtn-" & x Then
               c.Text = ButtonText
               c.ForeColor = System.Drawing.ColorTranslator.FromOle(btnFontColor)
               c.BackColor = System.Drawing.ColorTranslator.FromOle(btnBackColor)
               c.Tag = "ItemPageBtn-" & i
               c.Location = New System.Drawing.Point(gLeft, gTop)
        If btnPicture <> "" And btnPicture <> Nothing Then
                   gButton.Image = Image.FromFile(btnPicture)
               End If
               c.Visible = True
               c.Visible = True
               Exit For
           End If
        Next
while i run the program, the image is diplaying in correct button if picture path exist and button that didn't have the picture path is displaying the text.
but the image is not fitting inside the Button. i can see only half of the image. i need a way to make the Image stretched or reduced to fit inside button.
is it possible??? if anyone have any idea how to do this, please help me. and if you can provide an example, then it will be great help for me.
Thanks in advance.
remya1000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Image stretch or reduced to fit inside button in VB.NET
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08389 seconds with 12 queries