Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need to create a 'static' picture box control visible to other apps

Posted on 2004-08-08
7
Medium Priority
?
338 Views
Last Modified: 2008-02-01
I am using an app that will show video in a picture box on a form in my vb6 application.
All the app requires is that I name the picturebox something specific and that the picturebox control is 'static'.
1. Can you please tell me exactly what 'static' means in this context?
2. Is it possible to make the control static in vb6?  I have used SysTree++ to look at the example exe which was included and SysTree++ shows a [Static] description next to the control in the demo .exe, but the demo was created in c++.

This is driving me bonkers, I am just chasing my tail at the moment and am not sure if this is even possible.
Thanks
0
Comment
Question by:mikesteribar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11746207
If you just give it that specific name it doesn't work?

Darko
0
 

Author Comment

by:mikesteribar
ID: 11746216
No,

In the process viewer I see

Window: 0007032C "Form1" ThunderRT6FormDC
Window: 0007032E "" ThunderRT6PictureBoxDC

(also a couple of other lines, but these seem to be the relevant ones)
It seems that the form is visible, but I guess that the empty string in the second line is the problem for the picturebox?
0
 
LVL 22

Accepted Solution

by:
DarkoLord earned 500 total points
ID: 11746234
Okay, set the caption using this code:

Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

Private Sub Form_Load()
    SetWindowText Picture1.hwnd, "test"
End Sub

Darko
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:Shauli
ID: 11746243
Maube you need to create the picturebox on the fly and declare it as 'Static", as in:

Static myPicture As Control
Set myPicture = Me.Controls.Add("VB.Picturebox", "myPicture", Form1)

myPicture.Left = 120
myPicture.Top = 120
myPicture.Width = Me.Width - 360
myPicture.Height = Me.Height - 600
myPicture.Visible = True

S
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11746250
If you declare it as Static it doesn't make any difference... I think he just needs to change the caption my code above and it should work..

Darko
0
 

Author Comment

by:mikesteribar
ID: 11746282
Thanks DarkoLord,
Works perfectly :)
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11746293
You're welcome!

Darko
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question