如何在运行时清除图像(新手) [英] How can I Clear an Image during run time (Newbie)

查看:111
本文介绍了如何在运行时清除图像(新手)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

图像框正在通过If&然后声明,但我需要在条件改变之前清除它。

那里有没有''one-liners'?

解决方案

< blockquote>问候,Tomservo!


你可能比你想象的更近。由于if语句生成图像,为什么没有设置可见性为true / false,从而将一个图像替换为另一个图像。


示例:


如果这样那么那么

MyPic0.Visible = True

MyPic1.Visible = False


ElseIf this and That Then

MyPic0.Visible = False

MyPic1.Visible = True


ElseIf this ...

My ...

我的...


Else


MsgBox" Darn!"


结束如果


如果这不适合您,请发布您的if语句以便我们查看。

玩得开心:-)

D?k?ll



问候,Tomservo!


你可能比你想象的更近。由于if语句生成图像,为什么没有设置可见性为true / false,从而将一个图像替换为另一个图像。


示例:


如果这样那么那么

MyPic0.Visible = True

MyPic1.Visible = False


ElseIf this and That Then

MyPic0.Visible = False

MyPic1.Visible = True


ElseIf this ...

My ...

我的...


Else


MsgBox" Darn!"


结束如果


如果这不适合您,请发布您的if语句以便我们查看。

玩得开心:-)

D?k?ll



谢谢D?k?ll!我现在就开始了。



图像框正在通过If&然后声明,但我需要在条件改变之前清除它。

那里有没有单行?



另外一个快速提示,如果你真的试图清除图片而不是让它不可见,那么使用这个代码,

Pic1.Picture =没有什么


那将清除图像框,这样你就可以使用这样的东西......我猜...


Pic1.Picture = LoadPicture(C:\ MyPictures \ MyPic.jpg)


我不确定你的意思,所以我想我会给一个还有一点暗示:D $

亲切的问候

Devon。


The Image box is being populated via an If & Then statement, but I need to clear it before the condition changes.
Are there any ''one-liners'' out there?

解决方案

Greetings, Tomservo!

You may be closer than you think. Since you if statement produces the image, why no set visibility to true/false, whereby replacing one image with another.

Example:

If this and that Then
MyPic0.Visible = True
MyPic1.Visible = False

ElseIf this and that Then
MyPic0.Visible = False
MyPic1.Visible = True

ElseIf this...
My...
My...

Else

MsgBox "Darn!"

End If

If this does not do it for you, post your if statement so we can have a look.

Have fun :-)

D?k?ll


Greetings, Tomservo!

You may be closer than you think. Since you if statement produces the image, why no set visibility to true/false, whereby replacing one image with another.

Example:

If this and that Then
MyPic0.Visible = True
MyPic1.Visible = False

ElseIf this and that Then
MyPic0.Visible = False
MyPic1.Visible = True

ElseIf this...
My...
My...

Else

MsgBox "Darn!"

End If

If this does not do it for you, post your if statement so we can have a look.

Have fun :-)

D?k?ll

Thanks D?k?ll! I''ll get on it now.


The Image box is being populated via an If & Then statement, but I need to clear it before the condition changes.
Are there any ''one-liners'' out there?

Also a quick hint, if your actually trying to clear the picture and not just make it non-visible, then use this code,

Pic1.Picture = Nothing

That will clear the image box so you can use something like this i guess...

Pic1.Picture = LoadPicture("C:\MyPictures\MyPic.jpg")

Im not to sure which one you meant so i thought i would just give a little hint aswell :D

Kind Regards
Devon.


这篇关于如何在运行时清除图像(新手)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆