|
And if still facing trouble use .ToString("0.000") ..
Motivation is the key to software development.
|
|
|
|
|
Wrong. The value he's getting is because of the conversion from one floating point format to another. Formatting it to hide the inaccuracies does nothing when the value is used in calculations.
|
|
|
|
|
Ankit Aneja wrote: show same value
I didn't mean to do this (.ToString) during the calculations, but after the calculations, only for showing the correct number (which in fact is wrong, I see that)
Motivation is the key to software development.
|
|
|
|
|
Hi..
how r u ????
I have Q in Vb plz help me as soon as possible becoz i have 2 submit it
The Q is follwing:
Write a program that allows the user to draw 'free-hand' images with the mouse in a PictureBox. Be sure to provide the following:
1. A Button to allow users to clear the image in the PictureBox
2. A ListBox to allow users to change the colour of the pen. Provide few options for colour.
3. A way (radio or list) to set the drawing width. Provide few options for the width.
Be sure that when the user makes a selection from the menu, the appropriate control is updated to reflect the user's choice of colour and width.
Important Note: You will need to use some of the mouse events. In particular the mouse move event should contain your drawing rather than the paint event of the picture box.
RGDS
laila_B
|
|
|
|
|
This isn't a site where people do your homework for you. Do the work yourself, and if you have a specific question come back and ask it.
Scott
|
|
|
|
|
Thanx dear 4 replay but I am not wait smbody 2 do the work 4 me i am tryiny but the problme is when i run the form i drow in form it self not in picture box the follwing is code if u can help me
Public Class form2
Dim shouldpaint As Boolean = True
Dim paintcolor As Color
Dim paintwidth As Integer = 5
Dim drawpen As Pen
Dim paintline As New System.Drawing.Drawing2D.GraphicsPath()
Private Sub Picturedrowing_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Picturedrowing.Click
End Sub
Private Sub Picturedrowing_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Picturedrowing.MouseDown
shouldpaint = True
End Sub
Private Sub Picturedrowing_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Picturedrowing.MouseMove
If (shouldpaint) Then
Dim g As Graphics = CreateGraphics()
g.FillEllipse(New SolidBrush(Color.Red), e.X, e.Y, 30, 30)
g.Dispose()
End If
End Sub
Private Sub Picturedrowing_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Picturedrowing.MouseUp
shouldpaint = False
End Sub
Private Sub form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub lstwidth_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstwidth.SelectedIndexChanged
If Me.lstwidth.SelectedIndex = 0 Then
paintwidth = 5
ElseIf Me.lstwidth.SelectedIndex = 1 Then
paintwidth = 10
'using if statment to select diffrent width
ElseIf Me.lstwidth.SelectedIndex = 2 Then
paintwidth = 15
'ElseIf Me.lstwidth.SelectedIndex = 3 Then
' paintwidth = 16
End If
End Sub
Private Sub lstcolor_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstcolor.SelectedIndexChanged
'using if statment to select diffrent color
If Me.lstcolor.SelectedIndex = 0 Then
paintcolor = (System.Drawing.Color.Brown)
ElseIf Me.lstcolor.SelectedIndex = 1 Then
'using if statment to select diffrent color
paintcolor = (System.Drawing.Color.Blue)
ElseIf Me.lstcolor.SelectedIndex = 2 Then
paintcolor = (System.Drawing.Color.Red)
ElseIf Me.lstcolor.SelectedIndex = 3 Then
paintcolor = (System.Drawing.Color.Azure)
End If
End Sub
Private Sub Picturedrowing_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Picturedrowing.Paint
'Dim move = New Pen(Color.FromArgb(100, paintcolor), paintwidth)
'e.Graphics.DrawPath(move, paintline)
End Sub
Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclear.Click
Me.Picturedrowing.Refresh()
End Sub
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub
End Class
|
|
|
|
|
Hi,
you are looking for somebody to do your work?
Regards: Didi
|
|
|
|
|
hi,
m am good. Sorry, kan't help coz I have 2 do reel prg'ing werk todo.
u should do ur werk prior to posting here. Be sur to respond w/ how badly u need the help.
sinc,
J Deez
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I hope like hell that was a sarcastic use of a keyboard because that is one of the most painful posts to read.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Forget what the other are telling you. I will write the program for you, just send me payment of 5000 US Dollars first.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I'll do it for 4000.00$ and a cookie.
|
|
|
|
|
Done, please send the following details so I can pay you.
Name:
Address (include postcode please):
DOB:
Sex:
Mothers maiden name:
1st pets name:
Favourite password:
Bank A/C Name:
Bank Name:
Bank Address:
iBanking UserID:
iBanking Password:
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
laila_B wrote: becoz i have 2 submit it
Well then, you better get coding then. You don't want to be late do you?
|
|
|
|
|
Wheew, I think you get the message now, so I won't tease you anymore. Start taking a look at the Drawing (and Graphics) namespace. This[^] will cover some basics
Motivation is the key to software development.
|
|
|
|
|
Might help.
If everything was not true, would it be not true that everything is not true?
"Rules are merely limits on our potential." -Me
|
|
|
|
|
Hi...
This is graphics related. I have posted this already at the graphics forum.Didn't get any reply.So thought would post it here before giving up.I need to draw a map .I have the latitude longitude values of it .I was able to map(w-to v) these to screen coordinates and then draw the map.The problem i need help with is how do i do the reverse,because i need to show the latitude longitude values as the mouse moves over the map.For the initial case its simple,just rearrangement of window to view port mapping formula .i.e.,
u = (x-xmin)* sx+ umin
v = (y-ymin)* sy + vmin
But once the zoom and pan operations are applied on the map, I don't know how to get the latitude longitude values from the screen coordinate.
If some one knows how to solve this ,Please help me
Thanks in advance
|
|
|
|
|
Hi,
suvigna wrote: But once the zoom and pan operations are applied on the map, I don't know how to get the latitude longitude values from the screen coordinate.
Why do you write this, is there no way to figure out, what region the user has zoomed to? Otherways you have to calculate the reverse of your formula regarding the zoom-factor etc.
Regards: Didi
|
|
|
|
|
The zoom operation is being applied on the view port . Now once that is done the window that has to be mapped to the view port has changed.It becomes smaller, and its location changes wrt to the number of zooms.. i am unable to figure out how to keep track of this window.Once i can keep track of this window .. the reverse of the w to v formula can be used
|
|
|
|
|
Hi all,
modified 28-Nov-12 8:08am.
|
|
|
|
|
Research Data Binding, because that is what you need to do.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for the reply.
Will checkout Data Binding.
|
|
|
|
|
help with error providers for
telephone numbers
|
|
|
|
|
If you mean check a string for a valid telephone number format then I would use a regular expression.
|
|
|
|
|
|
I want to transfer the data displayed in listbox to a table and assign an IdNumber to each data transfer. And then to retrieve that data from that table for the relevant Id and after more additions to that data in list box, transfer again to table and save it permanently. I am using MsAccess as database. i have following data in list box in vb express 2008:
Description Quantity Price Amount
Order1 2 3 6
Order2 3 4 12
Order3 2 3 6
Order4 4 2 8
Total 32
So how i can transfer this data to a table giving it one Id and then retrieve that data in listbox from that table using the same id and after addition of more two Orders( Order5 and Order6) in the list box, transfer it back to that table for permanent save.
Kindly advise me the code for this requirement.
|
|
|
|