Solved

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

Posted on 2004-08-08
7
333 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
  • 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 125 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best way to parse out a json string in VB6? 10 224
VB6 - Convert HH:MM into Decimal 8 62
Zip Folders Using Chilkat Routines 1 58
VB script to continue despite error 2 16
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

828 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