VB 2008: What's The Counter Part Of Drawline
Apr 8, 2012
how to remove a line?I have:
Dim PenColor As New Pen(Color.Black) and after I received the values I draw the line with:
objGraphics.DrawLine(PenColor, Xstart, Ystart, Xend, Yend)
The user can do this 10 times... (so 10 lines)...But if the user presses a cancel button, the last line drawn shall be removed (and the user can click until he is back at 0)..Would I use PenColor white here (to draw over the line)? Or is there a way to remove line directly in visual basic? I couldn't find it.
View 12 Replies
ADVERTISEMENT
May 20, 2010
I have this code sample from a book I'm reading which looks to be incorrect:
Imports System.Diagnostics
Sub Main
Dim pc As New PerformanceCounter("PerfApp", "Clicks", False) 'excepiton here
pc.Increment()
counterLabel.Content = pc.NextValue().ToString()
End Sub
There excepion message I get is: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly. I looked for a property to see if I can set it but couldn't find one.
View 3 Replies
Feb 27, 2010
What is the value of the variable named counter after the following statements are executed:
Dim percent As Double = 0.54
Dim valid as Boolean = True
Dim counter As Integer = 1
[code].....
View 16 Replies
Feb 28, 2009
Public Sub TextBox3_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox3.KeyDown
counter1 += 1
End Sub
I set TextBox3 max length to 8.What code should i write if i want it to be like this:I wan the counter1 to stop increasing if the TextBox3 reaches 8 characters. (Even there's still key down occurs)After I click a button, the counter1 is able to increase again.
View 3 Replies
Jan 15, 2012
i am want to draw lines on a picture for my project.Apart from the PictureBox1.Refresh() function, i wanted to know which other functions can be applied to a PictureBox.Moreover, I am trying to draw a line from a point to another several times on the same picture.I am actually using the PictureBox1.Refresh() that is not effective in my case when I want all the lines I draw to remain on that same picture. Currently, when I am trying to draw another line, the first one is cleared and the new one only is shown.
View 1 Replies
Dec 22, 2009
Under normal circumstances I am not TOO bad at trying to figure errors out. However, I can't seem to understand why I am getting the age ol' "Object reference not set to an instance of an object error" in this lil bit of code.
This is where I define my 'intTotalRecords'
Connection.Open()
Command.CommandText = "SELECT * FROM CompanyTable"
[code].....
View 3 Replies
Dec 13, 2011
I just want to draw some lines between the rectangles in vb.net. I used g.drawstring() method to that.
But now, based on a value I just want to change the opacity of the arrow.
View 1 Replies
Oct 12, 2011
I support a program that captures a drawings from a digitizer tablet. The tablet functions as sort of a mouse and the user uses a Stylus to draw (sign) their name into documents. An issue that has come up is that the user signs their name but the line that the signature is build with has noticable holes in it. Kind of like having a pen that skips when you write. The information is communicated into a PictureBox using a DrawLine Function where it passes the line color, the previous point and the current point.Kind of stuck with this, not sure why the tablet would produce a spotty signature when the stylus is in contact the whole time with the tablet. I have yet to port out the line x,y points to see if the tablet is producing consistent points but this is the next step.
View 5 Replies
Jan 2, 2011
I'm a beginner to VB2010. If I draw a red line on a BLANK form, obviously its red. But if I draw a second red line, which crosses the first, is there a way of controlling the colour at the crossover position, for example returning it to the original colour of the form?
View 4 Replies
Sep 28, 2009
I have a AxAcroPDF on a from which i added from the toolbox I can draw on the form using this code
Private m_Drawing As Boolean = False
Private m_LastPoint As Point = Nothing
' Start drawing.
[Code]....
Is it possible to draw directly onto the AxAcroPDF Control?
The AxAcroPDF Control dosnt have the mouseup and mouse down declatations so i am unable to easily adapt the code.
View 3 Replies
Nov 22, 2010
I want to draw lines (paths) for AI to follow. I need to know the X,Y coordinates of each pixel in the line.Lines drawn straight vertical (0 or 180 Degs), diagonal (45 or 225 Degs), or horizontal (90 or 270 Degs) are easy to map.I need to know how to map straight lines that are not one of the those three. Like 1 degree to 44 degrees, 46 degrees to 89 degrees, and so on...
View 1 Replies
Nov 4, 2011
I am trying to draw a bus route as a simple sequence of lines. Nothing fancy. But instead of lines, I'm getting wedges. Initially I was fine with this, because the wedges sortof look like arrows and always face towards the second point. But now I want to improve the look, and the wedges are becoming a big problem.
My suspicion is some sort of floating-point issue due to the graphics transform (lat/lons are fed in and the transform turns them into x/y on the bitmap [assuming lat/lon is euclidean is accurate enough for my purposes], so the scaling is several orders of magnitude).
Screenshot:
It actually kind of looks like the line was split into two triangles but only one of them was drawn.
Relevant Code (note: drawing is done asynchronously, which is why I'm creating a bitmap):
'-- Creating the transform --'
Dim bitmap = New Bitmap(Math.Max(1, PictureBox1.Width), Math.Max(1, PictureBox1.Height))
Dim g = Graphics.FromImage(bitmap)
[Code].....
Using DrawLines instead of DrawLine solves the issue (but why?) Increasing the pen thickness makes the issue go away (but the lines are too thick) Zooming out (increasing lat/lon view window) makes the issue go away, eventually (but I want to zoom in!)
View 2 Replies
Nov 10, 2011
Hi, I'm using the Drawline method by capturing coordinates entered into 4 textboxes and then printing the image onto a picturebox. However, I can't get the previous line to be redrawn along with the new line that needs to be drawn. I understand that it refreshes when using the picturebox.refresh() function.
The code is:Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
View 6 Replies
Jul 28, 2010
i have a button and if a specific option is set (via a checkbox) then once every 5 times the button is clicked an extra event happens.I thought a counter/Integer would be the way to do it but i cant seem to get it quite right, heres my code i have in the buttonclick event:
[Code]...
View 3 Replies
Oct 13, 2008
Is there any way to have 2d graphics that gets made by user through manual dimensions input be bound to a text box?
Is there any way to take position 1000,600 and make that zero? Can we make graphics by inputting only the next co-ordinate and have the pc automatically draw a line from last point?
Also, whats the difference between drawline and draw path? How can I get the shape to remain on screen when I toggle between pages?
View 9 Replies
Feb 22, 2011
im making an application in vb.net (duh!) anyway i have created and coded the whole project and it performs exactly as i want it to (i dont need code help). my problem lies with the fact that my project is 2-3 parts
1.a setup form that gathers inital data about the enviroment stores this data encrypted in a config file. after inital setup this form is not displayed again. but needs to be run on both computers
2. the second form is the real application form im in the process of turning this part in to a background service anyway this form is the one that establishes the connection between two nodes it works correctly
3. the config files
anyway here is my problem i want to make this application distributional with just one file the (.exe) and have this .exe make everything else happen. it runs the setup form and creates the first config file which it does then it needs to produce a copy of just the second form and the config file to transfer to workstation #2 that will run independtly without the whole application which i cant make happen then it needs to turn both workstations application on by only starting one on either computer and invoke the other computer to start its corrosponding app also no idea how to make this happen any ideas or suggestions as to where to look to try to find my answers.im thinking i might need to make two seperate applications (a setup app, and the running app) and include them both in a project and use the setup.exe to to package them together this is a little side project that im making for my self to use to make programming a little easier so i plan on giving it out to some fellow students to test and tell me what they think so im not really worried about ease of use or complicated procedures yet but if it turns out to work and actually be of use to anyone else i would be willing to rewrite it to distribute to the masses but for now i just want it to work for me.
View 4 Replies
Sep 3, 2009
After running into much difficulty getting started on my little planner attachment, I found this C# program (calendar_src) floating around on the net...somewhere. So I have been working on trying to convert this from C# to VB, which I have been using an online converter. From what I know I have been going through and trying to edit the code after it has been converted to VB code as best as I can. But now I have limited the errors from over 50 to these:
Error1Overload resolution failed because no accessible 'DrawLine' can be called without a narrowing conversion:
'Public Sub DrawLine(pen As System.Drawing.Pen, x1 As Integer, y1 As Integer, x2 As Integer, y2 As Integer)': Argument matching parameter 'y1' narrows from 'Double' to 'Integer'.
[code].....
Not only this, the VB main Form1 isn't showing the "DayView1" control that the C# one is. When I first created the VB app, I didn't know how to make 2 projects in 1, so it's probably wrong altogether...but I tried. The only reasons I am wanting to go off of someone else's control is because it only lacks 1 feature that I want, and that's having a full month view, not just limited to 1-3-5-7 day views.
View 3 Replies
Jan 12, 2012
my requirement is that i have to count occurrence of a certain date and between two months
suppose i have 10-jan-2012 now i have a date range 1-jan-2012 between 1-feb-2013 my requirement is that if i find 10-jan between 1-jan-2012 between 1-feb-2013 irrespective of year i know that 10-jan will come twice between 1-jan-2012 between 1-feb-2013 i am not understanding how to do this.i meanto say that i have to compare only day and month part of the date which will solve my problem
View 1 Replies
Jul 1, 2009
Is there a way to load and get let's say only the first 500 characters of a website instead of the whole thing?
View 6 Replies
Jun 9, 2009
I have an image in a picturebox that changes, and the background of the image is ls always the same. is there a way I can change the background of the image? Here is the picture, or at least one of them.
The white background behind the character is what I need to remove. How can I replace certain colors of pixels with another color?
View 8 Replies
Mar 6, 2009
I have this HTML sting:
<img class="main-prod-img" src="http://www.ibood.com/img/product/4026_7n_hi_1236258897.jpg" alt="....
From that string i need to get the SRC part. so from the " to the ". Can tell me the regex code.
View 1 Replies
Jan 24, 2010
I'm doing program that I can capture a part of the screen. Heres code, I don't know why it's not working.
[code]...
View 11 Replies
Dec 16, 2010
If I have a string, like "FilesTwoFilesMoreFilesFile.txt". How can I split everything in front of the last to a string called 'firstPart' (That would be "FilesTwoFilesMoreFiles") and the 'secondPart' to be "File.txt"?
View 6 Replies
May 14, 2012
I want to be able to:
1) save the screen as an image
2) use this image and search for a smaller image inside of it (pixel sequence)
Basically, I need the program to detect when an image comes onto the screen.NOT a pixel color at a certain coordinate, it is similar to this but instead of one pixel, it should detect multiple ones.is there any way I can put the image I want to detect in a picturebox, and it will go look at that image and keep checking to see if it exists on the screen?I have it working for pixel detection (only 1 pixel), but it isn't very reliable as there could be many other instances of this color on the screen.
View 2 Replies
Mar 23, 2010
I'm saving potentially very large amounts of data to disk as a single serialized class. But there is a sub class that I would like to be able to retrieve and write back to the disk without having to read the entire file or write back the entire file. Trust me, my reasons for doing this are good, and the design behind this is more than correct.In VB6 this is very easily done. A single statement gets the portion of the data you want from the front of the file and saves it straight to the Type it belongs to, flawlessly. Likewise, if the dimensions of the data haven't changed, but only the values, then Put can be used to save it right back to the file without disturbing the integrity of the entire file.When needed, the entire file is read into a larger structure, and the entire file is put back, but only when necessary. Most of the time the only information being read from and written to the file are in the first few hundred kilobytes of the file.
Now that I've got serialization working, I'm trying to use it to read (deserialize) only the first member of the class serialized to disk. I haven't been able to find any examples of this anywhere that have lead me toward making the sort of progress I'm hoping for.So I suppose the first question is this: Is it possible to read only part of a serialized class from the open file stream? Specifically, in one case I want to read the first two integers stored in the class. In another case I want to read only the first block (sub class) from the open file stream. In both cases I do not want to read the entire file, but just what I'm interested in starting from block 0. I don't need to write back the integers to the first file, but I do need to write back the block to the second.Assuming that the answer to the above is yes. My second question would then be: How is this done? I want to work with the file stream already open rather than opening and closing file streams over and over.I
View 20 Replies
Feb 20, 2011
I have split container in which I am dragging controls (picture boxes). I would like that part of the dragged control (picture box) that is outside the split container to be invisible. Currently it is on top, and the entire control is visible. Please help me know how can that be accomplished?
View 9 Replies
Nov 24, 2010
How do I paint the part pointed to?
View 1 Replies
Jun 17, 2009
I'm wondering if it's possible to refresh only a part of a code, the reason why is that I'm adding an item from Form2 to a listbox in Form1.The code in Form2 for adding is : [code]I need to press a button in Form2 to trigger the refresh in the code I posted above + it needs to do this action.[code]
View 5 Replies
Mar 11, 2010
I have added a ribbon control to my application but i have a problem. i have added a simple button to that ribbon or Orb
When i click on the RibbonOrbOption at run time i just see this.But i do not see the item1 button displayed.
This is the properties menu image
View 3 Replies
Apr 12, 2010
I wanted to split a string before the ",". For Example "ARIAL, 9PT" I just want the bolded part "ARIAL".
Dim family_name As String = ""
Dim sentence As String
If Not (FontTypeComboBox.SelectedItem Is Nothing) Then
[Code]....
View 4 Replies