VS 2008 Draw Lines In VB Form?
Apr 5, 2010I need to draw lines, in one VB form. Like paint, I need the tool brush, and design some lines and curves in a Vb form. How can I do this? I don't know where to start.
View 3 RepliesI need to draw lines, in one VB form. Like paint, I need the tool brush, and design some lines and curves in a Vb form. How can I do this? I don't know where to start.
View 3 Repliesi want to "draw" zebra lines in my form [code] ican import background image, but I prefer code :)
View 1 RepliesThe image editor toolbar is not active. I would like to draw lines and shapes on a form.
View 1 RepliesHow do I draw lines using DirectX? (on my form)
View 1 RepliesI want to draw string in multiple lines and and I want to know how many lines given string will take. I am using following method.
[Code]...
I'm making the transition from VB6 to VB2008 and I'm having difficulty finding the equivalent to[code]...
It seems in VB2008 I can only use pens inside a picturebox1_onpaint() subroutine, I can't tell a picturebox what to do from a button_click subroutine or form_load subroutine first and then send the results to a picturebox. I have no control over when the graphics are drawn and from which subroutine. How do I solve this in VB2008 ?
I have a simple picturebox, line drawing procedure (call it "DrawTheLine"), which fires ok when I call it from a command button. But when I try to call it from the boot form_load procedure it doesn't work; no lines draw. No errors are raised.
Things I've thought of are:
1. The form_load procedure is not done creating all of the controls on the form, so it can't work with them yet. Doesn't make sense because my drawing call is the last thing in the form_load procedure, and it executes, but the picturebox does not show the lines.
2. Tried Application.DoEvents, but no go.
3. Tried using picturebox.invalidate to force a paint event and "called" the drawing procedure that way, with the appropriate arguments. Again, the procedure "DrawTheLine" fires, but no lines draw to the picturebox.
I have the following form:I want to join the boxes so that it looks like this: would rather create the lines on the userform manually but I do not think there is a way to do it. I've tried the following code but I cannot see the line:
Private Sub DrawLine(ByVal X_From As Integer, ByVal Y_From As Integer, ByVal X_To As Integer, ByVal Y_To As Integer, _
ByVal Line_Width As Integer, ByVal Line_Colour As System.Drawing.Color)
[code]....
Iam doing a sample project for school and i CHOSE Tic Tac toe. sample program of it becuase i have no idea where to start. And do I use a picture box to draw the lines?
View 1 RepliesI need to draw dashed lines. I use this code:
Dim MyPen As Pen = New Pen(Color.Black, MyWidth) With {.DashStyle = Drawing2D.DashStyle.Dash}
MyGraphics.DrawLines(MyPen , MyDots.ToArray)
But since the distance between successive lines it too short, the dashes start each one too near to the last. It causes a continuous black line
How would I do this? I want my Program to draw 2 lines in the center of the screen.
View 3 RepliesI can draw one line by mouse moving on a form, but i used cls function to clear screen when move mouse (otherwise it wont show single line when move mouse), so i cudnot draw next line with out clearing previously drawn line, kindly help how to solve this problm
[Code]...
I am making a drawing application (Graphics class), with a highlight pen and a calligraphy tool. But the pen tip should not rotate according to the line direction. I have tried the CustomLineCap, but still not working.
View 3 RepliesHow to draw lines inside the circle. I mean a circle with n-number of lines within in it.
View 7 RepliesFirstly I am using Vb 2008 Express Edition.I have the following code:
Code:
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e _
As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim x1 As Integer = 0
Dim x2 As Integer = 50
[code]....
When I run the above code it works , no problem. But I want to trigger it only on my Button_click event.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
I don't know how to call the PictureBox1_Paint into my Button1_Click
I'm trying to draw a grid using vertical and horizontal lines.Both For..To statements work fine when one of them is commented out otherwise, they won't work together. At run, only the first For..To statement is executed.[code]
View 6 RepliesI have some lines drawn in many different directions (2D y 3D enviroments). Is there any way to draw text oriented along the direction of each of these lines? It was an easy task in former versions of Visual Basic, but now it looks like a very tough -almost impossible- mission.
View 4 RepliesI'm trying to do something that is turning out to be out of my league at the moment. I need to draw geometric figures. These geometric figures have all the coordinates of their corners. Say I have a trapezoid, and I would want to draw it. The drawing would be done in a picturebox or a panel or a groupbox (some part of the form where only the geometric figure will be).
I saw the method on how to do that Here and that's exactly what I'm trying to achieve, but there it's drawn on a newly created form, and I need it in a picbox, panel or groupbox as I mentioned above. I also need the drawn figure to be at the center of the picbox/panel/groupbox.
The coordinates of the lines should be like (xa.text,ya.text) to (xa.text - xb.text, ya.text + yb.text) if I'm not wrong for the first line of the geometric figure and so on.
How do I draw lines like these ones at top (underneath the white box) and bottom (above the buttons) - preferably in the GUI?
View 6 RepliesI think we can just draw an image that resemble the grid using this article : drawing in a datagridview Currently creating a way to make the image drawn in tile mode. Each time I develop a datacentric application using VB.NET regardless of how much the data displayed in the datagrid, I always want the grid to display full row of empty data, not just blank panel. Can we achieve this using VB.NET design time property? And also, we must not trigger the display of vertical scrollbar this way..
View 1 RepliesI am currently using Visual Basic 2008 Express Edition.I want to make a program that will draw 700 random lines on it initially. I tried my code but the lines only appear in the same way such as straight line and diagonal line. Here's my code:
Public Class Form1
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
[Code].....
I've got a project where I want to be able to display a world map and draw lines between cities.I've looked at using a web browser with google maps but don't want it to have to be used while "online"
I've looked and longitude and latitude and converting these to UTM co-ordinates but i'm lost for how to place these on world map programaticly.I have a full list of all cities used in my program and have a list of their latitude and longitude co-ordinates because i need to work out thier distance apart which I have already done the code for.
I have started to work some more on my 'shape editor'. If you're not familiar with it,ust imagine the Visual Studio form designer: a 'canvas' (the form) with a bunch of 'shapes' (the controls) that can be selected, moved, resized, etc. I have just finished implementing snapping between shapes and the canvas boundaries. But now I am having some slight issues with painting the snap lines.Just FYI: this is what I mean by snap lines:The blue lines that indicate that the 'buttons' are snapped to each other, and a purple line indicating that button1 is snapped to the boundary.
My shape editor is based loosely on jmcilhinney's 'manipulating GDI+ drawings' codebank entry, and a central idea in that post is to only draw what is necessary. In other words, when I move a shape I could re-draw the entire canvas, but it is much faster and smoother to only re-draw the old and the new location of the shape. Since nothing else has changed, I don't need to draw the rest. So, I simply invalidate the old bounds and the new bounds, and even with a lot of shapes all moving simultaneously it still feels very smooth.
How would I be able, with the click of a button, allow the user to draw on the form? Maybe as if, taking a screen shot of the whole form, and then drawing on top of it? Dose not have to be a lot of colors, just a simple way to draw a line.
View 4 RepliesI am using VB 2008 and wonder if there is a way to draw lines between the data elements in two listviews to bind the elements together?
View 1 Repliesi want to draw a line on my picture box but i would like have another line but on rotate condition (on the same time i move my mouse to draw a line)
-i know how to draw a line
-i know how to rotate a picture
but i don't know how to combine that two things
Private m_LastPoint As Point = Nothing
Dim LPen As New Pen(System.Drawing.Color.Black)
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PicPad.MouseDown
[code]....
I set my FormBorderStyle of my form to none.This is exactly what i want, except I ran into a problem.When the background is gray (background of other applications running in the background), my form tends to fade in with the background (Still active, but i cant see where my form starts or ends).
View 1 RepliesDear all, I'm new in the forum. I have a simple but annoying problem: in a ordinary form I added a label (Label1) and a button (Button1) with the followiing handler.Well if I press Button1 my dot dashed line is correctly drawn over Label1, but what I need is that program automatically does it on form loa
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Graphic As System.Drawing.Graphics
[code].....
I display a Chart with several graphic lines on it. What I want to do is draw a line (using the mouse) overtop or below the chart such that it can be seen on the chart. The mouse line draw code is below. What is required is either make
the line always be on top or make the chart transparent. I don't know how to do either and I don't know if it is possible in Visual Basic 2010 as it was in VB2.
Private Sub frmComDashBrdGraph_MouseDown(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
[Code].....
i am newbie in constructing layouts in crystal report.i have details section in left side of the page
Subject A |_______|________|________ | Subject B |_______|_________________| Subject C |_______|________|________ | Subject D |_______|_________________| Subject E |_______|____Total__|________ |
there can be different number of rows at the left side,meaning it depends on output of the query.And heres the problem, i need to make another table at the right side. how to make a table at the right side or draw lines without affecting details section? this is just purely table without fields on it.