Hi Im using VB express 2005
I encountered some problems while drawing shapes in visual basic. Whenever i print shape on the picturebox it appears, but when i minimize it or go to another form and then come back to the form where the picturebox is, the image will disappear and i have to click the button for the image to be visible again. Is there any way to make the image stay? - Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
-
-
-
Dim gr As Drawing.Graphics = PictureBox1.CreateGraphics
-
-
Dim br As Brush = Brushes.Blue
-
-
-
-
Dim blackPen As New Pen(Color.SkyBlue, 3)
-
' Create location and size of ellipse.
-
Dim x As Single = 4.0F
-
Dim y As Single = 7.0F
-
Dim width As Single = 25.0F
-
Dim height As Single = 30.0F
-
' Draw ellipse to screen.
-
gr.DrawEllipse(blackPen, x, y, width, height)
-
gr.DrawEllipse(blackPen, 29, 7, 25, 30)
-
gr.FillEllipse(Brushes.Pink, x, y, width, height)
-
gr.FillEllipse(Brushes.Pink, 29, 7, 25, 30)
-
gr.DrawRectangle(Pens.SkyBlue, 53, 17, 20, 10)
-
gr.FillRectangle(Brushes.Pink, 53, 17, 20, 10)
-
-
End Sub
Regards
dr3amxstar
6 1911
maybe you have to put the code behind the form to
maybe you have to put the code behind the form to
Im sorry i dun get what u mean
If i put the code under form1_load, no image wil come out
Now my image is able to stay but it does not respond to my button click.Instead the image comes out when the form loads. - Public Class Form1
-
-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
-
PictureBox1.Invalidate()
-
-
End Sub
-
-
Private Sub PictureBox1_Paint(ByVal sender As Object, _
-
ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
-
-
-
Dim objPen As New Pen(Color.Blue)
-
-
-
e.Graphics.DrawRectangle(objPen, 10, 10, 200, 150)
-
e.Graphics.DrawLine(objPen, 10, 10, 210, 160)
-
e.Graphics.DrawLine(objPen, 210, 10, 10, 160)
-
-
-
End Sub
-
-
End Class
haha Solved already :D
Ah, you're too good for us!
Ah, you're too good for us!
nah... im not, haha just lucky.. you guys have been a great help to me :D
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Andrew James |
last post by:
Gentlemen,
I'm looking for a graphing or drawing python package that will allow me
to draw complex geometric shapes. I need to be able to create shapes
like cogwheels and Venn diagrams:
http://encyclopedia.thefreedictionary.com/Venn
The library must support alpha blending and the ability to return x,y
co-ordinates for a shape, as I want to draw an imagemap on top of parts
of the shape.
|
by: Ron Adam |
last post by:
I want to be able to easily create reusable shapes in Tkinter and be
able to use them in mid level dialogs. So after some experimenting I've
managed to get something to work.
The following does pretty much what I need, but I think it can be
improved on. So could anyone take a look and let me know what you think?
Some of the things I want to add, but aren't exactly sure how at this time:
Nested groups
Use tags to be able to change sub...
|
by: steve bull |
last post by:
I have a program in which I draw various shapes to a form but I would like to move it off the form into a user control.
The painting on the form takes a significant amount of time. I was thinking of making a bitmap map to the control so
that when it does a refresh it doesn't need to recalculate everything. It is easy using the form because I have clipping
and all the graphics draw routines(line, polygon etc). Is there a way to draw to a...
|
by: Heatland |
last post by:
Hi
I have not done anything like this using VB. I need to draw many round shapes on a rectangular. Can anyone point me do a right direction on where to start or give me some example code? Thanks very much in advance.
|
by: Andreas Schubert |
last post by:
Hello newsgroup,
I am pretty new to .NET and need some advise on
how to approach to the following:
I have to create an application with a drawing surface, where some
predefined shapes (picture boxes with icons in it) can be dropped and moved
around.
This should work like some MS Visio on a very basic level.
The shapes should be dragged from a list.
| |
by: Dursun |
last post by:
Collegues, is it possible to do the foloowing:
Let end user draw specific shapes (a circle that has a number within it and
a connector that points to a specific area on the background image) using
Windows Forms and controls. To be more specific, I want to design a VB.Net
Windows form where end user will mark damages on an airplane picture (which
might be background picture of the form) using a marker object that has a
circle (with a...
|
by: Tina |
last post by:
I need to find drawing software for my websites. I'm guessing that Adobe
Photoshop is an overkill. What's best for creating bitmaps usable for
websites?
Thanks,
T
|
by: ddecoste |
last post by:
I have a need to add a visual representation to some data in Access.
I need to draw a matix of squares inside another square. I have all
the data that I need in a record in Access. The data changes
according to what the user inputs. I know that Access does not allow
you to draw on forms so I decided to put the output in an Excel file
for the user but I am having trouble drawing the rectange from
Access. Here is my simple code so far:
...
|
by: mattc66 via AccessMonster.com |
last post by:
Does anyone know of some simple line drawing add-on apps. I just need to be
able to do some simple line drawing with dims. 4 walls and a door and allow
the user to type the dims for the walls. All simple.
Thanks
MAtt
--
Matt Campbell
mattc (at) saunatec com
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |