Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default image1.bordercolor not showing

Hello,
I have an Image on a Userform that I want to flag/unflag
by changing the border color red/black. (Word97/WIN98)

Private Sub Image1_Click()
If Image1.BorderColor = RGB(0, 0, 0) Then
Image1.BorderColor = RGB(255, 0, 0)
TextBox1.Value = "red"
Else
Image1.BorderColor = RGB(0, 0, 0)
TextBox1.Value = "blk"
End If
DoEvents ' doesn't fix it
End Sub

The text "red"/"blk" works, but the color doesn't change.
"DoEvents" was a feeble try.
TIA, Dave


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default image1.bordercolor not showing

What's Image1.BorderStyle? If it's 0 (fmBorderStyleNone), it doesn't matter
what color you set, there's no border.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Dave D-C" wrote in message
...
Hello,
I have an Image on a Userform that I want to flag/unflag
by changing the border color red/black. (Word97/WIN98)

Private Sub Image1_Click()
If Image1.BorderColor = RGB(0, 0, 0) Then
Image1.BorderColor = RGB(255, 0, 0)
TextBox1.Value = "red"
Else
Image1.BorderColor = RGB(0, 0, 0)
TextBox1.Value = "blk"
End If
DoEvents ' doesn't fix it
End Sub

The text "red"/"blk" works, but the color doesn't change.
"DoEvents" was a feeble try.
TIA, Dave


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption
=----



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default image1.bordercolor not showing

I can't see the OP in my newsreader, only quoted in Jon's reply.

Anyway, assuming the border is not 0 as Jon suggest, may well need to do a
Me.Repaint after changing the border colour. Personally I avoid both Repaint
and DoEvents unless absolutely necessary.

A better overall solution IMO is to use a label as the border which also
gives the option to resize the 'effective' border.

Add a Label to the form named Label1

Sub PicLabel(bFlag As Boolean)
Dim bdr As Single
Dim clr As Long

Me.Label1.ZOrder 1

If bFlag Then
bdr = 3
clr = RGB(255, 0, 0)
Else
bdr = 0.75
clr = 0
End If
With Me.Image1
Me.Label1.Move .Left - bdr, .Top - bdr, _
.Width + bdr * 2, .Height + bdr * 2
End With
Me.Label1.BackColor = clr

End Sub

Call PicLabel before showing the form, say in the Initialize event, with
bFlag True or False as required.

In Image1_Click() -
PicLabel (Me.Label1.BackColor = 0)

Regards,
Peter T



"Jon Peltier" wrote in message
...
What's Image1.BorderStyle? If it's 0 (fmBorderStyleNone), it doesn't

matter
what color you set, there's no border.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Dave D-C" wrote in message
...
Hello,
I have an Image on a Userform that I want to flag/unflag
by changing the border color red/black. (Word97/WIN98)

Private Sub Image1_Click()
If Image1.BorderColor = RGB(0, 0, 0) Then
Image1.BorderColor = RGB(255, 0, 0)
TextBox1.Value = "red"
Else
Image1.BorderColor = RGB(0, 0, 0)
TextBox1.Value = "blk"
End If
DoEvents ' doesn't fix it
End Sub

The text "red"/"blk" works, but the color doesn't change.
"DoEvents" was a feeble try.
TIA, Dave


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption
=----





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fix my spreadsheet from showing formula to showing answer SimplyQuick Excel Discussion (Misc queries) 4 October 7th 08 10:00 PM
Insert image by clicking on Usreform Image1 Corey Excel Programming 2 May 28th 07 11:49 AM
Remove Picture from Image1 on a Userform Abdul[_2_] Excel Programming 1 October 3rd 06 02:12 PM
Userform problem, bordercolor not changing around images spyd3r Excel Programming 0 January 5th 06 01:19 AM
Picture show in image1 Ivica Lopar Excel Programming 6 November 13th 05 09:57 PM


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"