|
This question would be better handled in the ASP.NET Forum since this is a Web Forms related question.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am new at writing vb.net code I am a student and I am having a hard time understanding how code works and how to properly use it. My current project consists of creating an assignment grader. I have no clue how to work out the code I have several books but I am not getting it for some reason. Is there someone out there that can give me some guidance on how to write code. Here is a link to what it should look like. Any help would be appreciated.
Thanks.
https://mycampus.aiu-online.com/courses/itp410/LE2.gif
|
|
|
|
|
Ok, I don’t want to give you all the code, but let me give you some hints.
1.Draw your form and declare 3 form level variables one for the test score, one for the extra credit, and one for the timeliness
something like private mintExtraCredit as integer
2.in the checked change event of the radio buttons, write code that assigns the value for the timeliness or the extra credit as appropriate.
something like
Private Sub radExtraCreditNone_CheckedChanged(sender As Object, e As EventArgs)
mintExtraCredit = 0
End Sub
3. In the click event of the button write code that takes the value of the numeric up down box, Ill call nudTestScore and adds it all together, or what ever math was needed to be done on those numbers, and displays in the label box, Ill call it lblFinalGrade be sure to use the tostring method like below.
like
Private Sub btnComputeGrade_Click(sender As Object, e As System.EventArgs) Handles button1.Click
mintTestScore = nudTestScore.Value
lblFinalGrade.text=(mintExtraCredit+mintTimelyness+minTestScore).ToString()
End Sub
I hope this helps!
|
|
|
|
|
tazbird,
I declared the 3 form level varibles but when I debug it, it still shows errors. I would like to list it on here so that maybe you or someone else can help I have already turned in the project unfinished so I will take a major hit on my grade. I really just do not understand how to piece it all together so it will work. I cant even write proper code. I have the beginners guide to writing code but all it does is give me examples writing code. It doesnt explain why you write what you write in code. I feel like a 5 year old trying to learn to read. I will post my project in zipped file for all to see what I have managed to figure out with my books I have now. Maybe someone here can give me some more insight as to what I am doing wrong.
Thanks again tazbird for you help it does help me a little bit.
Mtate32
|
|
|
|
|
tazbird here is my last project I was forced to turn in unfinished
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged
rad5_1_2daylate_checkedchanged()
Dim gdb1_2Late = -5
End Sub
Private Sub TextBox1_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Show(Dim_A,B,C,D,E,F As String)(A=>90_B=>=80_C=>=70_D=>=60_F=>=50)
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
rad4_ontime_CheckedChanged()
Dim gdbOntime = 0
End Sub
Private Sub RadioButton6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.CheckedChanged
rad6_2daylate_checkedchange = -100
Dim gdb2daylate = -0
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
rad3_Aboveaverage_Checkedchange = +5
Dim gdbExtraCredit(Aboveaverage = +5)
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
rad2_Average_Checkedchange = +3
Dim dbExtraCredit(Average = +3)
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
rad1_None_Checkedchange = 0
Dim gdbNone = 0
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
btnCompute_Click(total)(numericupdown1_Groupbox1_Groupbox2 = TextBox1)
End
alphanumericgrade_A,B,C,D,F (A=>90_B=>80<90_C=>70<80_D=>60,70_F=>50,60)
End Sub
End Class
As you can see I still have no real clue what I am doing.
Mtate32
Me.RadioButton4 = New System.Windows.Forms.RadioButton
Me.Button1 = New System.Windows.Forms.Button
Me.Label2 = New System.Windows.Forms.Label
Me.TextBox1 = New System.Windows.Forms.TextBox
CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(32, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(64, 16)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Test Score"
'
'NumericUpDown1
'
Me.NumericUpDown1.Location = New System.Drawing.Point(96, 16)
Me.NumericUpDown1.Name = "NumericUpDown1"
Me.NumericUpDown1.TabIndex = 1
Me.NumericUpDown1.Value = New Decimal(New Integer() {100, 0, 0, 0})
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.RadioButton3)
Me.GroupBox1.Controls.Add(Me.RadioButton2)
Me.GroupBox1.Controls.Add(Me.RadioButton1)
Me.GroupBox1.Location = New System.Drawing.Point(16, 72)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(120, 120)
Me.GroupBox1.TabIndex = 2
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Extra Credit #1"
'
'RadioButton3
'
Me.RadioButton3.Location = New System.Drawing.Point(8, 88)
Me.RadioButton3.Name = "RadioButton3"
Me.RadioButton3.TabIndex = 2
Me.RadioButton3.Text = "Above Average"
'
'RadioButton2
'
Me.RadioButton2.Location = New System.Drawing.Point(8, 56)
Me.RadioButton2.Name = "RadioButton2"
Me.RadioButton2.Size = New System.Drawing.Size(88, 24)
Me.RadioButton2.TabIndex = 1
Me.RadioButton2.Text = "Average"
'
'RadioButton1
'
Me.RadioButton1.Location = New System.Drawing.Point(8, 24)
Me.RadioButton1.Name = "RadioButton1"
Me.RadioButton1.Size = New System.Drawing.Size(56, 24)
Me.RadioButton1.TabIndex = 0
Me.RadioButton1.Text = "None"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.RadioButton6)
Me.GroupBox2.Controls.Add(Me.RadioButton5)
Me.GroupBox2.Controls.Add(Me.RadioButton4)
Me.GroupBox2.Location = New System.Drawing.Point(224, 72)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(110, 120)
Me.GroupBox2.TabIndex = 3
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Timelines"
'
'RadioButton6
'
Me.RadioButton6.Location = New System.Drawing.Point(8, 88)
Me.RadioButton6.Name = "RadioButton6"
Me.RadioButton6.TabIndex = 2
Me.RadioButton6.Text = "2+ Days Late"
'
'RadioButton5
'
Me.RadioButton5.Location = New System.Drawing.Point(8, 56)
Me.RadioButton5.Name = "RadioButton5"
Me.RadioButton5.TabIndex = 1
Me.RadioButton5.Text = "1-2 Days Late"
'
'RadioButton4
'
Me.RadioButton4.Location = New System.Drawing.Point(8, 24)
Me.RadioButton4.Name = "RadioButton4"
Me.RadioButton4.TabIndex = 0
Me.RadioButton4.Text = "On Time"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(16, 216)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 40)
Me.Button1.TabIndex = 4
Me.Button1.Text = "Compute Grade"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(152, 224)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(64, 16)
Me.Label2.TabIndex = 5
Me.Label2.Text = "Final Grade"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(224, 224)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.TabIndex = 6
Me.TextBox1.Text = ""
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.LightSkyBlue
Me.ClientSize = New System.Drawing.Size(360, 277)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.NumericUpDown1)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Assignment Grader"
CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox2.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged
rad5_1_2daylate_checkedchanged()
Dim gdb1_2Late = -5
End Sub
Private Sub TextBox1_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Show(Dim_A,B,C,D,E,F As String)(A=>90_B=>=80_C=>=70_D=>=60_F=>=50)
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
rad4_ontime_CheckedChanged()
Dim gdbOntime = 0
End Sub
Private Sub RadioButton6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.CheckedChanged
rad6_2daylate_checkedchange = -100
Dim gdb2daylate = -0
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
rad3_Aboveaverage_Checkedchange = +5
Dim gdbExtraCredit(Aboveaverage = +5)
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
rad2_Average_Checkedchange = +3
Dim dbExtraCredit(Average = +3)
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
rad1_None_Checkedchange = 0
Dim gdbNone = 0
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
btnCompute_Click(total)(numericupdown1_Groupbox1_Groupbox2 = TextBox1)
End
alphanumericgrade_A,B,C,D,F (A=>90_B=>80<90_C=>70<80_D=>60,70_F=>50,60)
End Sub
End Class
As you can see I still have no real clue what I am doing.
Mtate32
|
|
|
|
|
OK I am not asking you to do my homework for me but I really need help understanding what I am doing so here is my next project due this comming sat.
Design and develop a program that validates the value a user enters into a TextBox control to ensure that the entry is a valid telephone number. The application should accept a maximum of 12 characters. When the user clicks a button, the program should determine if the entry is of the form 999-999-9999, where the character 9 represents any number.
If the entry is determined to be a telephone number, display an appropriate message, along with the separate substrings that compose the telephone number without the dashes. If the entry is not a telephone number, then display a message as to the reason why the entry is not a valid telephone number, clear the TextBox control and set focus to the TextBox control. Use String class methods to solve the problem.
Here are a few hints to help you code the String methods:
1. Check that the user has entered two dashes in the appropriate spaces.
2. Break the string into 3 substrings, represented as 999,999, and 9999.
Use the Visual Basic .NET IsNumeric() function to determine whether each substring is a valid number. The function accepts one parameter and returns a True or False value.
Here is some information about the IsNumeric function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisnumeric.asp
|
|
|
|
|
I'm like you chief. This class is kicking my butt. I found something that might help you but not sure I can post it in this particular forum. I haven't quite figure it out but it gives you a great start, I think.
Believe me guys, I am totally confused.
|
|
|
|
|
I will try to see if I can work this out with what link you gave me here it is for anyone else who may be in the same boat??????
http://www.vbcity.com/forums/topic.asp?tid=72607&highlight=telephone%7Cnumber[^
Ok all I hope I make it through this one.....
|
|
|
|
|
Help! Its URGENT!! I'm using u.are.u 4000 fingerprint sensor to link with my vb.net application via the USB port. I cant get the original format of the picture captured via that device. The original format of the captured picture should be bmp format, 500 width and 550 height, 700 resolution. But, What i get is a png format, 105 width and 137 height with 96 only for resolution.
This is the sample code provided by the vendor in vb:
Private Sub RegSample_RegSample(SamplePicture As stdole.Picture, CurFingerIndex As Integer)
Image1(CurFingerIndex).Picture = SamplePicture
End Sub
I found that value for "SamplePicture" is an integer random number, for example, 671419403, -1475865658 and so on. I'm stuck here. Anyone can help me to get or keep the original format of the captured image? If you do have any solution, do remember to email me at sscome@yahoo.com
I really pray to get valuable replies and assistance from anyone who have knowledge about this. Its urgent!....thanks
|
|
|
|
|
You're going to have to contact the manufacturer of the device for help on this one. It would appear that their library is not behaving as documented.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I have a databound combobox on the form. In the formload event the combobox is connected tot te datatable (created in a class).
By every change of the selected value, the program makes 4 new datatables and has has to populatie listvieuws, datagrids and other comboboxes.
When I run the program with an breakline on the selectedvaluechanged event of the first cobo box I see that these precedures are executed several times.
I takes a long time before the form is shown.
How can I make that the first time that the selectedvaluechanged event is triggerd after the form is showed ?
|
|
|
|
|
1. need help for using ANSI code with VB6 for Language
Conversion
2. need help for using UNICODE with VB6 for Language
Conversion
Please Help
With Any one Option.
most urgent
|
|
|
|
|
I want to create a form with no FormBorder. I then want the form to move when the user clicks and holds the mouse (MouseDown), then moves the mouse. Any clues on how to accomplish this?
|
|
|
|
|
|
I have a datatable filled with data.
How can I query a cell in the table to see if it has changed since the last acceptchanges?
I'm familar with the column changing event. I want something similar to this where i can query the original value and proposed value etc. But I want to just make reference to a cell in the table and test it at my own liesure.
I can do this with a row by typing the following:
if drw.RowState = DataRowState.Unchanged then
' Do something...
endif
Is there any way to test the following for a change?
dataset.tables(0).rows(0).item <--has changes
And if so is it possible to test the current value against the oginal value in the cell?
I want to check if a certain cell value has changed and action the result.
Thanks Glenn
|
|
|
|
|
Do you know how I can capture the filename of an object (file) being dropped into an Access table's OLE object container?
Here is what I have:
1) Access 2000 with a table (fields: RecId, Filename, Blob)
2) the field Blob is an OLE object
What I want:
A) drag a file (from Windows Explore listing) and drop into OLE object - DONE!
B) programmatically record the filename of the source (file being drag-dropped)
What callback in VBA code should I react upon (mouse up? on update?)
BONUS!
I have a form tied to my blob table. When I drop into the OLE container, it shows the file as it would appear in its "Native Application" - would prefer simple ICON or nothing.
Thanks for the help.
Johnny
|
|
|
|
|
I was wondering if and how one would go about reading the information within a textbox seperated by multiple delimiter's
such as \ and \\ and \\\ to create a Folder structure. one \ is the base folder two \\ would be asub folder and three\\\ would be a folder within a subfolder. Thanks for any help as i have no clue.
eg. lets say we want to create a file structure "c:\folder\subfolder\\subfolder\\subsubfolder\\\
this would give you a regular folder and two seperate subfolders the second of wich has a subsubfolder like this:
folder
|
/ \
subfolder subfolder
\
Subsubfolder
P.S. Thanks for any help.
Late
Puppetgrimm1
Pupetgrimm1@aol.com
From: Las Vegas , NV
|
|
|
|
|
I’m trying to access one row in a table based upon its int value held locally in a variable. (I increment the 'count' variable in the application.) As you can see below, 'count' is the local variable in the application. Can this be done or is there another way?
-Shannon
If count < iResultQuery Then
myConn_.CommandText = "SELECT WorkInstructions.InstructionText FROM WorkInstructions
WHERE WorkInstructions.StepNo = count"
end if
|
|
|
|
|
spettiford wrote:
If count < iResultQuery Then
myConn_.CommandText = "SELECT WorkInstructions.InstructionText FROM WorkInstructions
WHERE WorkInstructions.StepNo = count"
end if
Should be:
If count < iResultQuery Then<br />
myConn_.CommandText = "SELECT WorkInstructions.InstructionText FROM WorkInstructions<br />
WHERE WorkInstructions.StepNo =" & count<br />
end if
hope that helps
|
|
|
|
|
THANK YOU!!! I knew there was a way, but just didn't get the syntax correct. It works great and you saved me.
|
|
|
|
|
your welcome
and for string variables:
myConn_.CommandText = "SELECT BLAH FROM BLAH_TABLE_NAME WHERE BLAH_TABLE_NAME.BLAHCOLUMN_NAME (OPERATOR)'" & report_type & "'"<br />
|
|
|
|
|
|
I have created a class library in which I have created customised textbox columnstyle.
When I click on the cell of this datagrid,actual text box is made visible(normaly text is painted in the cell using drawstring method of in overriden paint method.) & we can edit the text in it. but this text box is not handling arrow keys! The focus is lost from the text box if we click arrow keys. because data grid was handling these events. I checked these events in datagrids overriden method 'IsInpunkey' method & tried to return true whih will avoid further processing of key by base class method but it didn;t worked. I also tried to handle this through textbox's IsInputKey method, but it failed there also.
Can any body tell me why is this hapening & how can I make arrow keys work in my text box.
Thanks.
|
|
|
|
|
I have been attempting to find my own method for controlling the "boundaries" of child windows within the main parent. So far I have come up with:
Private Sub childform1_LocationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.LocationChanged<br />
If childform1.Location.X < 144 Then<br />
' childform1.Visible = False<br />
'cannot use the visible= False as this cause the application to crash.<br />
childform1.Location = New System.Drawing.Point(144, childform1.Location.Y)<br />
'childform1.Visible = True<br />
End If<br />
If childform1.Location.X > 753 Then<br />
'childform1.Visible = False<br />
childform1.Location = New System.Drawing.Point(144, childform1.Location.Y)<br />
'childform1.Visible = True<br />
End If<br />
If childform1.Location.Y > 442 Then<br />
'childform1.Visible = False<br />
childform1.Location = New System.Drawing.Point(childform1.Location.X, 0)<br />
'childform1.Visible = True<br />
End If<br />
'for the main form<br />
F1.AutoScroll = False<br />
'F1.Refresh()<br />
End Sub
The above code works fine, does what I need it to, but there is a large amount of flickering going on when the form is moved. I tried to prevent this by making the form invisible when the relocation was going on but the application crashed as a result.
Does anyone have an idea I might try to prevent the flickering?
|
|
|
|
|
How Can I Create Query Builder Using VB By DAO Connection
S.venkatesh
|
|
|
|
|