User Profile
Collapse
-
For some reason my text did not post with the code - so here it is! I am finishing up a class in VB and would like some assistance in a program. I need to do the following: the user needs to select a drawing tool, line color and line width (have these displayed in comboboxes). when they click draw they can draw using the selected items and with the drawing start with mouse down and end with mouse up. I am able to get a drawing in the picture box,... -
drawing in a picturebox
Imports System.Drawing. Graphics
Public Class Form1
Inherits System.Windows. Forms.Form
Dim x1, y1, x2, y2 As Integer
Dim red, black, blue, green, orange As Color
Dim x, y, w, h As Integer
Dim rectangle, freehand As Graphics
Dim line As Graphics
Dim wide, n As Integer
Dim myPen As Pen
#Region " Windows Form Designer generated code... -
Thank you so much for your message. I will try your suggestions this afternoon and let you know what happens.Leave a comment:
-
entering file contents into an array
I am a student finishing a class in Visual Basic, and would like some assistance with a program I am working on. I need to read the contents of a file (showing makes of cars on one line and a daily rental fee on the following line) into an array and then display the file contents in a list box. The user then chooses the car he/she wants to rent. I then need to obtain the rental fee from the array and use that value to calculate the total rentals.... -
I GOT IT TO WORK!! I wrote a function to store the new value and that did the trick!!...Leave a comment:
-
I am still havingn problems with this - I can get the counter to increase by one for a button click, but I cannot get the clicks stored so they will be used to increment the next button click.
I have done the following code:
Private Sub button1_Click(B yVal sender As Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim totclicks As Integer
Dim n As Integer
Do
...Leave a comment:
-
problems with enhanced button control
I am using Visual Studio.NET 2003 and have built a enhanced button control (enhbutton) to capture the number of times the button has been clicked. I did the code and did a build. I then added a test program (buttontest), added the enhbutton control and set buttontest as the startup program. I cannot get the number of times the button is clicked to display on the face of the button. A 0 is put in by the enhbutton code as the starting point. My code... -
enhanced button control that counts clicks
I have built an enhanced button control which I want to use to capture the number of times the button has been clicked. I have added the new control to a test program but cannot get it to work. The code for the enhanced control is as follows:
Private Sub EnhBtn_Click(By Val sender As System.Object, ByVal e As System.EventArg s) Handles EnhBtn.Click
End Sub
Public Property totclicks() As Integer
Get
Dim n As... -
Thanks for your help! Please accept my apologies for posting to the wrong forum. I use both .NET 2003 and VB 2005 and sometimes get confused! I will also post to the correct forum. Again, my thanks and apologies....Leave a comment:
-
enhanced button control
I have built an enhanced button control which I want to use to capture the number of times the button has been clicked. I have added the new control to a test program but cannot get it to work. The code for the enhanced control is as follows:
Private Sub EnhBtn_Click(By Val sender As System.Object, ByVal e As System.EventArg s) Handles EnhBtn.Click
End Sub
Public Property totclicks() As Integer
Get... -
format for datetimepicker
I am working on a program where I have two datetimepickers and need the difference in days between the two dates. I have the format property for both set to short. When I add the datetimepicker to a label it prints as 12:00:00AM instead of as a date.. How do I format this to return tghe day of the month selected in the picker?
Dim d1 As Date = DateTimePicker1 .Value
Dim d2 As Date = DateTimePicker2 .Value
... -
I have now got the text names for the labels to be filled in by the control when the test program is run. The problem now seems to be with the code I have for the total number of days between the datetimepicker1 (date1) and datetimepicker2 (date2). In an attempt to find the problem, I selected date1 to print and got a value of 1200 AM so apparently need to do a conversion somewhere to get just the date. The code is below:
Public...Leave a comment:
-
Yes,, I have the control on the form and have referenced the test project to the control....Leave a comment:
-
I got a message that what I entered had not been declared. I entered thwe name of the control.totdays , or daterange.totda ys. I put this in the click event for the button in the test program....Leave a comment:
-
-
My intent is to take the totdays from the custom control and then multiply it by 50 in the test program. I am using VB 2003 for this exercise....Leave a comment:
-
VB.NET: testing a custom control
I am having difficulties getting the date interval to calculate and to get the text added to the labels. I know the code in the test program works if I get the total days, so the problem is with the code for the control. When I print Date1 I get 12:00 AM but cannot seem to get the datetimepicker to use dates in the calculation.
Thanks for your willingness to help!
The code for the custom control:
ReadOnly... -
Thank you so much for your guidance! Works fine now and I have learned something new!!Leave a comment:
-
calculating interest
I am working on a program in which the user enters an amount of money in a textbox, selects a beginning and ending date using the datetimepicker, and then the program calculates the new amount based on an interest rate of 1% compounded monthly. The code I have written is as follows:
Public Class Form1
Private Sub cmdCompute_Clic k(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles cmdCompute.Clic k... -
Thanks for your help! The problem was not in the code, but in how I was getting the results; what you gave me solved that problem (many thanks!!!)...Leave a comment:
No activity results to display
Show More
Leave a comment: