在一个PICTURE和LABEL控件中,如果LABEL控件在PICTURE控件上画出来是可以看出来的,但是如果不是在PICTURE画出来, 在窗体上画出后MOVIE移动到PICTURE.LEFT,PICTURE.TOP,那么LABEL控件就看不出来(就像隐藏了一样),所以请大家帮我解决一下这个问题.我想MOVIE移动后到PICTURE上仍然可以看出来.

解决方案 »

  1.   

    在label上击鼠标右键,选择置于顶层
      

  2.   

    那有没有其它方法呢?我是在PICTURE上画出来的,我如果在上面添加文字的话它就会移到PICTURE控件的上面, 我现在想让它位于PICTURE控件的中间, 用MOVE后就会出现我上面说的问题。
      

  3.   

    好像有问题的,我用MOVIE就看不见了,你是怎么做到的?
      

  4.   

    如果单单是为了显示图片,用image吧,它和label在同一层,
      

  5.   

    Private Sub Timer1_Timer()
    GetWindowRect Picture1.hwnd, rect4
    GetCursorPos rect2
    If rect2.x >= rect4.Left And rect2.x <= rect4.Right And rect2.y >= rect4.Top And rect2.y <= rect4.Bottom ThenElse
    Picture1.picture = normal.picture
    End If
    Label1.Move Picture1.Left, Picture1.Top
    End SubPrivate Sub UserControl_Initialize()
    Picture1.Width = 1125
    Picture1.Height = 345
    UserControl.Width = Picture1.Width
    UserControl.Height = Picture1.Height
    End Sub我只是做一个控件,就是这样子,我在测试的时候在控件上添加其它文字就会移到PICTURE控件的上面,我只想让它居中能.
      

  6.   

    This has been a frequently asked question lately so I thought I'd try to address it here.Image, Label, Line and Shape controls are all examples of "lightweight" controls. These controls do NOT have the full set of properties of regular controls because they do not possess a Window of their own (they have no hDC or hWnd property). As such, they are smaller than regular controls.Since they have no window, they draw themselves on their *parent*, ie. the form or container.Thus, instead of a window containing a graphic floating on top of a form, a lightweight control is painted directly ONTO the form. So you can't very well slip a regular control behind it. It would be like trying to slip the regular control behind the form itself.This also explains why you can have transparency with lightweight controls and not with regular controls. Since the control has no window of it's own, it is transparent by default.A traditional drawback of lightweight controls is that you can't use regular API functions with them because they have no hDC or hWnd. This is particularily annoying in the case of the image control. However, the image is drawn onto the PARENT control and that control *does* have an hDC, so it turns out you *can* use API functions with image controls. It just takes a little API.For instance, since the image is drawn on the surface of the form, you can simply use the hDC of the form and offset the coordinates to the location of the image. You can get the hDC by using GetDC to convert the hWnd to a device context. Otherwise, if the AUTOREDRAW property is set to true, the hDC of a form is set to the Image property, not the window surface.