Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-08-08
7
Medium Priority
?
340 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 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

877 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