473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How make a picturebox public to forms?VB.net

MJ
i have form1 and form2, form1 has a picturebox which i
wish to make it accessible to other forms
after form2 perform some drawing, it need to call
form1.picbox.invalidate() to refresh the picbox, how to
declare the picbox?anyone have idea?

dim frm1 as form1
frm1 = new form1()

frm1.picbox.invalidate

the above code will not work becoz i not wish to create a
new instance of form1, wat i wan is to refresh the picbox
that already has some drawing on the activated form1..
any help is greatly appreciated...
Nov 20 '05 #1
3 1479
I've answered your question in the microsoft.public.dotnet.general
newsgroup. Please do not post your question multiple times...

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"MJ" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
i have form1 and form2, form1 has a picturebox which i
wish to make it accessible to other forms
after form2 perform some drawing, it need to call
form1.picbox.invalidate() to refresh the picbox, how to
declare the picbox?anyone have idea?

dim frm1 as form1
frm1 = new form1()

frm1.picbox.invalidate

the above code will not work becoz i not wish to create a
new instance of form1, wat i wan is to refresh the picbox
that already has some drawing on the activated form1..
any help is greatly appreciated...

Nov 20 '05 #2
Cor
Hi MJ,

To make it more easy I would use a showdialog.

That goes
dim frm as form2
frm.showdialog
me.picbox.invalidate
frm.dispose

After form2 closes, it goes automaticly back to form1.

If this does not work because a special aproach of you, message it, this is
not the only way, but it is the most easy one

I hope this helps?

Cor
i have form1 and form2, form1 has a picturebox which i
wish to make it accessible to other forms
after form2 perform some drawing, it need to call
form1.picbox.invalidate() to refresh the picbox, how to
declare the picbox?anyone have idea?

Nov 20 '05 #3
* "MJ" <an*******@discussions.microsoft.com> scripsit:
i have form1 and form2, form1 has a picturebox which i
wish to make it accessible to other forms
after form2 perform some drawing, it need to call
form1.picbox.invalidate() to refresh the picbox, how to
declare the picbox?anyone have idea?

dim frm1 as form1
frm1 = new form1()

frm1.picbox.invalidate

the above code will not work becoz i not wish to create a
new instance of form1, wat i wan is to refresh the picbox
that already has some drawing on the activated form1..
any help is greatly appreciated...


You will have to pass a reference to your instance of 'Form1'. The code
above will create a /new/ instance. How this can be done depents on the
structure of your application. The reference can, for example, be
passed in a parameter of a method or in a property of the 2nd form.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jose Michael Meo R. Barrido | last post by:
Hi! Can u please tech me a way to know if the image in the picturebox has changed? what event should i catch the chage?
4
by: Ed Landau | last post by:
In VB6.0, I can put an image on a form and assign it's .picture property at run-time. In VBA (within MS Access), when I put down an image control on a form, it asks me for the source to the image...
7
by: Randy Vande Hei | last post by:
Does anyone know how to change the the GDI+ coordinate system like you used to be able to do in VB6 with the picturebox.scale method. The picturebox.scale method took an x,y point defining the...
2
by: David Ricker | last post by:
I have created a PictureBox control which can have it's Image property directly bound to an image field in a database. This works perfectly for showing the images that are in the database. When I...
16
by: Neal | last post by:
Hi, I saw the VB6 Code to do this at this link: http://www.dotnet247.com/247reference/msgs/11/56581.aspx The VB6 Code reads as follows: Private Type Rect Left As Long
0
by: akh | last post by:
I want to use de Drag and Drop ´s event to move a picture box from a form and within a Picture Box. But I have behaviour if the MyPBox As PictureBox as the Globale varible or not Thanks for...
5
by: Christopher Kurtis Koeber | last post by:
Dear All, This may sound like an elementary question but how do you implement scrollbars for the Picturebox control. Do I have to create my own code to do this or is there some property that I can...
3
by: EnglishMan69 | last post by:
Hello All, I am using VB2005 Beta 2 in VS 2005 and am running into a small problem. I need to be able to add a picture box to the main form from within a thread. The program goes to a web...
3
by: kirk | last post by:
I have a form with a PictureBox control on it. The .Image property is set to a PNG file(which shows the picture of the US map) with some transparency in it. The .BackColor property is set to...
0
by: =?Utf-8?B?RG9jdG9y?= | last post by:
I am making an application that streams video from a web camera onto the client area of a PictureBox on a Windows CLR Form in MS Visual Studio 2005 (using C++). The streaming video works fine, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.