有关隐藏和显示一个Windows窗体资源 [英] Resources related to Hiding and showing a windows form

查看:229
本文介绍了有关隐藏和显示一个Windows窗体资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图片的格式,并点击一个按钮后,另一种形式会出现包含完全相同的图像一个图片框。 我使用这行code:

I have a form which has a picturebox and after clicking on a button another form will appear with a picture box containing the exact same picture. I use this line of code:

Image1.Image = vImage.Image

事情是我做这之后我需要隐藏的形式,再次显示它能够看到的变化。我使我一眨不眨的用户,我想避免或做隐藏和显示形式的等价物。这怎么可能,code是这样的:

The thing is after I do this i need to hide the form and show it again to be able to see the changes. I cause me a blink for user which I want to avoid or do an equivalent of hiding and showing a form. How is it possible, the code looks like this:

Public Sub UpdatePhoto(ByVal FullName As String, ByVal vImage As System.Windows.Forms.PictureBox)
timAnimate.Enabled = False
Me.Text = FullName
Image1.Image = vImage.Image
Me.Refresh()
Me.Hide()
Me.Show()
Image1.Visible = True
Call ShowTheWindow()

结束小组

推荐答案

我不太下面为什么你需要隐藏和显示形式。你只是试图让的形式来刷新?如果是这样,只需拨打:

I'm not quite following why you need to hide and show the form. Are you just trying to get the form to refresh? If so, just call:

Application.DoEvents()

否则,你可以尝试无效的控制:

or else you can try invalidating your control:

Image1.Invalidate()

这应当引起你的表单进行更新。你不应该需要隐藏和重新显示。如果这不是你的问题,让我知道更详细的问题是什么。

That should cause your form to update. You shouldn't need to hide and show again. If this isn't your issue, let me know in more detail what your problem is.

这篇关于有关隐藏和显示一个Windows窗体资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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