Unwanted Lines/curves In Picturebox?

May 4, 2010

I'm working on a program that will generate and graph random parabolas with integer vertices. I've got a 360n x360 pictureBox set up and used a for-next loop to draw in a grid consisting of 15 x 15 squares. when I plot the generated parabola I get some unwanted lines/curves. I think this is due to the fact that the (0, 0) point of the picturebox is in the upper left corner and the (0, 0) of my grid is in the center of the picturebox. Is there a way to "move" or "set" the pen position to the first point I wish to plot for my parabola without leaving a mark or trail? Or is there something else I can do? I've tried drawing an invisible line before my g.DrawCurve(plotPen point) but when the DrawCurve is executed I still get an extra line.

Private Sub cmdParabola_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdParabola.Click
Dim x, xPlot, y, yPlot As Single

[Code].....

View 4 Replies


ADVERTISEMENT

Get The Lines Or Curves From A Text?

Jun 5, 2009

I would like to get the lines or curves from a text. I was looking and I found ExtTextOutW or GetGlyphOutline.

Do you know where is a sample? I found some of vb6 and vc++ but I can not do running.

View 4 Replies

Draw Lines In A Picturebox?

Oct 25, 2008

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 ?

View 7 Replies

Drawing A Lines In A Picturebox?

Jan 18, 2011

I've looked and tried.. and for some reason just don't seem to be getting right now.

I have a picturebox that is 250x500, I want to draw a vertical line from the top to the bottom.

Using gs = pbMap.CreateGraphics
'Do While x.X < 250
'gs.DrawLine(Pens.Red, x, y)

[Code].....

View 7 Replies

Lines Won't Draw To Picturebox?

Apr 11, 2009

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.

View 15 Replies

Graphics: Picturebox Intersect With Lines?

May 25, 2011

There's this form with many random lines connected to one another using

Me.CreateGraphics.DrawLines(Pens.Black, pointsArray)

There's also a Picturebox that can be moved using the arrow keys...

I want a messagebox to show when the picturebox overlaps/intersects with the lines.
How can I do this?

View 2 Replies

VS 2008 - How To Make Graphics Tool Lines Stay On PictureBox

Jul 3, 2009

My picture box is in a panel. How to prevent lines created using graphics tool from getting erase when moving the picture box around? Sometimes when I minimize my form, the lines goes missing also.. How do I make the lines stay on the picture box?
Example shown below in a gif...

View 2 Replies

.net - Joining Two Bezier Curves?

Jan 24, 2012

i have two bezier curves placed at a distance apart in space.curve 1 has control points A0, A1,A2, A3. A0 and A3 lie on curve and are its end points Curve 2 has control points C0,C1, C2, C3 . C0 and C3 lie on curve.and are its end points

i want to join the two curves A and C with an intermediate bezier curve B. the intermediate Curve B has control points A3 and C0 which lie on the curve and are its end points. the intermediate control points B1 and B2 are unknown to me. also the joining should be smooth enough. please help as to how to proceed. have read alot about beziers but dont know how to do this.

View 2 Replies

Cubic Bezier Curves / Get Y For Given X

Nov 21, 2011

I have a cubic bezier curve where the first and last points are given (namely P0(0,0) and P3(1,1)).The other two points are defined like this: cubic-bezier(0.25, 0.1, 0.25, 1.0) (X1, Y1, X2, Y2, also those values must not be smaller or larger than 0 or 1, respectively)Now what would I have to do to get the Y coordinate for a given X, assuming there's only one? (I know that under certain circumstances there can be multiple values, but let's just put them aside. I'm not doing rocket science over here, I just want to be able to get Y multiple times per second to do transitions)I managed to dig up this: y coordinate for a given x cubic bezier, but I don't understand what xTarget stands for., also this is no homework whatsoever, I'm just a bit pissed at the fact that there's no comprehensible stuff about cubic bezier curves on the internet.

View 1 Replies

How To Draw Curves Along Edges

Aug 23, 2009

I did not really want to create as what i am showing in the second picture. What i actually wanted is to draw a curved (maybe a porsche, ferarri , or a lamboghini). Can i know how to draw curves along the edges ?

View 7 Replies

Joining Two Bezier Curves?

Jan 16, 2009

i have two bezier curves placed at a distance apart in space.curve 1 has control points A0, A1,A2, A3. A0 and A3 lie on curve and are its end pointsCurve 2 has control points C0,C1, C2, C3 . C0 and C3 lie on curve.and are its end pointsi want to join the two curves A and C with an intermediate bezier curve B. the intermediate Curve B has control points A3 and C0 which lie on the curve and are its end points.

View 7 Replies

VS 2010 Maze - Moving A PictureBox Between LineShape Lines Using Buttons To Move It

Apr 23, 2011

I'm doing a maze using VB10. its about moving a PictureBox between LineShape lines using buttons to move it. the problem is, can I make the picture not to move through the LineShape? if so how? or should I use something else other than the LineShape and another question can i save the progress of the maze and come back to it later? if so does it require using a database to save the location of the PictureBox?

View 3 Replies

Zedgraph - Y2 Axis Curves Won't Plot

Jul 25, 2010

I have followed a tutorial from Zedgraph's wiki but I still seem to be having issues. When I run the code below, only the 3 curves on the Y Axis plot. I know the datasource is correct from which the 4 curves on the second Y axis are being created, because I have checked the table after creation. For some reason, however, the curves do not show up and the Y2 Axis does not change its scale to reflect any new curves. Does anyone see what I'm missing here?

[Code]...

View 1 Replies

Flickering - Double Buffered Picturebox - Not Double Buffere - Black Screen With The White Lines

Nov 17, 2010

I have a htpc project that I am working on. The main program loads dll plugins which are basically other win forms. On each of these forms, including the main program, I use a picturebox (a double buffered picturebox) for the background image and then draw everything on it by hand. Whenever I load the form from the dll and show it, I get a weird flicker. It looks like it is the previously used double buffer. Is there any way to clear the background double buffer before the flicker? Or am I going in the wrong direction?

Here's a couple of videos of the problem:
[url]
[url]

Notice the black screen with the white lines on it or the flash of the desktop after I click "Movies." How do I get rid of that?

View 14 Replies

.net - Unwanted Settings Directory?

Dec 4, 2010

I have a WPF application that targets .NET 4.0. When the application starts the %ProgramData%Company NameApplicationVersion directory is created. It is an empty directory. I am not using My.Settings. Why is this directory created and how can I prevent it from being created?

View 2 Replies

Getting Rid Of Unwanted Characters In The Textbox?

Feb 17, 2011

I am trying to show the square root of the number entered in the textbox. when the user presses Q (Uppercase), the square Root should be shown (in the textbox). I did manage to get the sqaure root, but the problem is that when I press Q the Letter Q is also typed in. For example, if I enter 25 in the textbox and press Q then I get Q5 as the result. Is there any work around to this problem ? Below is the code that I have used.

Private Sub Textbox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Chr(81) Then '81 for Letter Q
Dim root As Double = Math.Sqrt(Val(TextBox1.Text))

[code]....

View 3 Replies

How To Get Rid Of Unwanted Button Border

Oct 22, 2011

If I use a button, I can't get rid of the white border apearing around it as soon as I press it. It stays there even after until I press something else. In the button properties I declared the Flatstyle as Standard because I like that look the most.

View 9 Replies

Unwanted Round Up In Datagrid?

Feb 5, 2010

I have a datatable that has a float data type. I give it a value of say 88.88. I then create a datagridview on a form but the cell value is diplsayed as 89.00. I cannot work out why!

View 4 Replies

.net - Unwanted Retriggering Of Textbox Events?

May 24, 2010

This is one of those "seems obvious" as how to do, but came across interesting side effect in implementing. I'm trying to keep two text boxes syncronized when information is updated. In this example, I will be using txtStartDate and txtEndDate. If the txtStartDate is changed, then the txtEndDate should should be updated. Likewise, if the txtEndDate changes, I want the txtSartDate to be updated. The side effect I'm comming across is that when I set them up under the TextChanged event for both, the events seem to retrigger against each other indefinately (endless loop?). Am I using the wrong event? Is this a task for a delegate?

View 3 Replies

.net - Unwanted Wait Cursor In WinForms App

Jul 14, 2009

I have an MDI WinForms app in which the MDI parent form has a ToolStrip, MenuStrip and StatusStrip. Whenever the mouse is moved over one of these controls the cursor changes to a 'wait' cursor (a arrow with an hourglass). This seems to be default behaviour in that there is no code to make this happen. The UseWaitCursor property of both the ToolStrip and MenuStrip is false; StatusStrip does not have this property. This occurs in both debug and release builds and confuses the users who think that the app is 'doing' something when really it isn't! Does anyone know what is causing this to happen, and more importantly how to make it stop?

View 4 Replies

Remove Urls Containing Some Unwanted Domain?

Sep 29, 2011

I have a list of URLs in a listbox and I want to remove the Urls containing some unwanted domain for example google.com also I want to know if is possible remove all URLs no containing a domain for example yahoo.com

I have the same problem in a ritchTextBox.

View 11 Replies

Unwanted Automatic Scrolling By Keyboard?

Jan 12, 2012

I've been constructing a small footprint grid control for Winforms.

After adding a vertical scrollbar I noticed that up and down keyboard strokes on the control move the scrollbar. I added no handler to support this functionallity. Indeed I do not want it. Anyone know where this event resides and what is the proper way to override it?

View 2 Replies

Unwanted Selection Of All Contents In Textbox

Feb 10, 2011

I'm using VB 2005 and MS Access 2000. I have a process that does some "stuff" with the data, re-queries the database, re-populates the form then displays a messagebox indicating that the process has completed. My issue is that after clicking OK in the messagebox, that whatever textbox the cursor was in prior to starting the process, now has all the text in it highlighted. If I don't show the messagebox then this doesn't happen. And if I don't call the process that repopulates the form controls, this doesn't happen. There's no code in the app that selects the contents of the textbox so is there a property somewhere that controls this?

View 1 Replies

Unwanted ToolTip Text In DataGridView

Feb 8, 2012

I have an unbound data grid view. Every cell that has text will display ToolTipText for that value. I'd like certain cells to have no ToolTip and others to have a ToolTip that provides instruction on what the "X" button is for rather than just having "X" display. If anything, for this particular cell, I'd probably rather have no ToolTip. I've tried setting the ToolTip.Text ="" for the cell immediately after creating the row. On other cells, if I change the underlying text value, I try altering the displayed tip text, but only get the text value for that cell.

How can I remove/modify unwanted ToolTips in my DataGridView?

View 10 Replies

VS 2008 Unwanted Form Resizing?

Aug 13, 2009

developed my app on a Vista laptop and deployed it on an XP desktop. When deployed the Form and even some controls are resized so text and portions of controls are not visible.Next I moved the project files and VB to the XP desktop and published the application on that machine. Same result, in fact the sizes were changed within the properties of the forms and controls within the project files

View 14 Replies

Removing Unwanted Reports Stored In Database

Oct 7, 2010

I have developed a VB .net application which uses SQL CE as its database engine. It works great so far. I recently added a section to remove unwanted reports which are stored in the database. The app correctly pulls ReportIDs from the table, which the user can select. The program will then delete the records based on the ReportID from the database. I know this records because, for testing purposes, message boxes inform the user of how many records where collected.

Dim SQLDeleteData As String = "DELETE FROM ReportData WHERE (TableID = @ID)"
Dim Con As New SqlCeConnection(DataBaseCon)
Dim DeleteData As New SqlCeCommand(SQLDeleteData, Con)
Dim ReportDelete As Integer = -1
DeleteData.Parameters.Add("@ID", SqlDbType.Int).Value = CInt(ListView1.SelectedItems(0).Text)
noOfDeleted = DeleteData.ExecuteNonQuery
MsgBox("Records Data Deleted " & noOfDeleted)

When the form refreshes to show the user the possible ReportID's, the list no longer contains the recently deleted ReportID. Now this is where I am getting confused. When I go through the server explorer and look at the database there, in the appropriate tables the data still exists. Through the server explorer new query builder, I can still create a select statement to allow me to view the data I just deleted. Does the server explorer create some type of local cache that replicates the database in someway? Are there really two copies of the database somewhere?

View 2 Replies

Showing A Form Activates An Unwanted Event?

Nov 20, 2010

I have a Visual Basic 10 program that one forms call another form.. On the called form I have a checkbox object and a 'Click' event associated with it.

My problem is that when the first form 'calls' the second form the second forms Checkbox's click event is called. it only happens when the form.show is used for the first time.

View 3 Replies

Unwanted Image Changing Between 2 Picture Boxes

Oct 14, 2009

I started computing at college about a month ago and have been learning to program in Visual Basic 2008 Express. I decided one weekend that I would try and make a pretty simple game that I may be able to use for my coursework at some point (I know Visual Basic isn't everyone's first choice for games programming but I thought I could try), I have learn a great deal from doing this but have encountered a rather odd bug in the program.

[Code]...

View 9 Replies

Unwanted Result When Executing Command In Mysql

Jan 15, 2012

i have a table named Tuition with fields:

[Code]...

View 11 Replies

VB 2010 Express Does An Unwanted Shut Down And Restart

Oct 8, 2011

Everything works OK with my VB program except, all of a sudden now, whenever I attempt to brush across a text string with the cursor intending to hilite the string I get an error message saying "Microsoft Visual Basic 2010 Express has encountered a problem and needs to close."Where-upon VB shuts down and restarts.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved