473,771 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.in validate() to refresh the picbox, how to
declare the picbox?anyone have idea?

dim frm1 as form1
frm1 = new form1()

frm1.picbox.inv alidate

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...
Jul 21 '05 #1
2 1961
There is an article describing how to do this:
Working with Multiple Forms in Visual Basic .NET
http://msdn.microsoft.com/library/de...us/dv_vstechar
t/html/vbtchWorkingWit hMultipleFormsI nVisualBasicNET UpgradingToNET. asp

Describes how working with multiple forms has changed from previous editions
of Microsoft Visual Basic and illustrates several key techniques, including
displaying a second form, changing the appearance of another form, and using
a form as a dialog. (8 printed pages)

--
Greetz

Jan Tielens
_______________ _______________ __
Read my weblog: http://weblogs.asp.net/jan
"MJ" <an*******@disc ussions.microso ft.com> wrote in message
news:04******** *************** *****@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.in validate() to refresh the picbox, how to
declare the picbox?anyone have idea?

dim frm1 as form1
frm1 = new form1()

frm1.picbox.inv alidate

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...

Jul 21 '05 #2
There is an article describing how to do this:
Working with Multiple Forms in Visual Basic .NET
http://msdn.microsoft.com/library/de...us/dv_vstechar
t/html/vbtchWorkingWit hMultipleFormsI nVisualBasicNET UpgradingToNET. asp

Describes how working with multiple forms has changed from previous editions
of Microsoft Visual Basic and illustrates several key techniques, including
displaying a second form, changing the appearance of another form, and using
a form as a dialog. (8 printed pages)

--
Greetz

Jan Tielens
_______________ _______________ __
Read my weblog: http://weblogs.asp.net/jan
"MJ" <an*******@disc ussions.microso ft.com> wrote in message
news:04******** *************** *****@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.in validate() to refresh the picbox, how to
declare the picbox?anyone have idea?

dim frm1 as form1
frm1 = new form1()

frm1.picbox.inv alidate

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...

Jul 21 '05 #3

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

Similar topics

15
1822
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
28197
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 (at design-time). Why? Why can't I find PictureBox in VBA within MS Access? And most importantly...why can't I put either in a Report within MS Access? What I really want is to be able to display pictures in an MS Access report (pictures...
7
17487
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 upper left corner and a second x,y point defining the lower right corner. In VB6 the 0,0 location was the upper left like in GDI+, but I could at least reset it so I could use it with lat/lons. Basically all I want to do is be able to use the...
2
2437
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 paste a new image into my control, it shows the new image and updates the image property. Problem is... It doesn't update the bound field! Any thoughts as to what I've done wrong? Any help would be greatly appreciated. The code for the...
16
9380
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
3884
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 your help, Here is the code.
5
11121
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 set? Thank you very much for your time and consideration in this matter! Christopher Koeber
3
3695
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 site, performs a search based on POST variables, retrieves the code, parses the information (including a url for a thumbnail image) and displays the results. I am using threads, since the program will appear to freeze while
3
5375
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 Transparent. This so far, works perfect. I now, would like to put another PNG image(an arrow showing positioning on the map) over the last PictureBox. The problem i'm having, the background for this second PictureBox only stays transparent when...
0
3166
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 now I am trying to create an image overlay. I am assuming that the best way for me to do this is to create a second PictureBox that lays over the streaming video. I would then need to draw directly into the bitmap shown in the overlaying...
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9910
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.