|
I am taking my first programming class in VB. I am working on an assignment that involves calculating a selling price with the cost sold of a vehicle and the results is suppose to show the total commission earned from the sell, total number of vehicles sold and the average commission and also a counter. Everything on my form works as designed except for my calculate feature.
If I can just get the calculation between the selling price and the cost sold to work then I think I can eventually figure out the rest of the coding. Can someone please point me in the right direction on how to code this issue?
Thanks
Stephen D. Weaver
Technician II
COLSA Corp.
Digital Wizards Division
sweaver@colsa.com
|
|
|
|
|
Stephen, can you post the code that is not working for you and then we can take a look.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
I dont get this message, could anybody help me?
System.NullReferenceException: Object reference not set to an instance of an object.
at Infragistics.Win.ControlUIElementBase.StartHoverTimer()
at Infragistics.Win.ControlUIElementBase.CheckMouseHoverStatus(UIElement element)
at Infragistics.Win.ControlUIElementBase.ElementEntered(UIElement element, Boolean triggerMouseLeavesOnly)
at Infragistics.Win.ControlUIElementBase.SyncMouseEntered(Boolean triggerMouseLeavesOnly, UIElementInputType inputType)
at Infragistics.Win.ControlUIElementBase.SyncMouseEntered(Boolean triggerMouseLeavesOnly)
at Infragistics.Win.ControlUIElementBase.SyncMouseEntered()
at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify)
at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize)
at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)
at Infragistics.Win.UltraWinGrid.UltraGridUIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)
at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe)
at Infragistics.Win.UltraWinGrid.UltraGrid.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
|
|
|
Spaz80 wrote: System.NullReferenceException: Object reference not set to an instance of an object.
It means that you have not initialized an object correctly and its reference variable is still NULL.
Use the call stack trace provided in the message to pinpoint the code in error.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
(Translation: I'll show you the way, but not write the code for you.)
|
|
|
|
|
I have the following function
Public Function AddSheetCopy(CopyName As String, NewName As String)
For Each xlSheet In xlApp.worksheets
If xlSheet.Name = NewName Then
MsgBox ("sheet exists")
Exit Function
End If
Next xlSheet
MsgBox (xlApp.worksheets(1).Name)
xlApp.worksheets(CopyName).Copy after:=xlApp.worksheets(xlApp.worksheets.Count)
xlApp.activesheet.Name = NewName
Set xlSheet = xlApp.activesheet
End Function
It's pretty simple, I just want to make a copy of a worksheet, and give it a new name. Problem is it's not working exactly as it should. You will notice in the above code there is a message box to display the name of the first sheet, when running the code as above it works, but if you comment out that message box, it makes a copy of the current active worksheet.
Obviously I don't want to be plagued with this message box, but I am unable to make the function work without it.
Any ideas?
|
|
|
|
|
Hi all,
How to calculate exact difference between two dates? For example I have date of birth and today’s date and now I want to exact age of that person. i.e. Years, months and days (23 years, 2 months and 15 days). I want to know is there any method in VB.Net to calculate the above. If not how can I achieve the task?
Please help me.
Regards,
Krishnaraj
|
|
|
|
|
|
|
Hi All
I have a small problem that I hope someone will be able to help with...
I have a windows app that does a lookup in a DB table to find words that match in its glossary.
If the word finds a match in the glossary table, I want to have that word highlited (With a Clickable Link) in a RichTextBox so that the user can click on the link and another window will open up and display the glossary entry.
I don't have a problem doing the lookup. It's the inserting a link into the RichtextBox in the middle of plain text, for the word that has a glossary entry. I cant use the DetectUrls property as that is only for web links.
If you know how to do this, Thank you.
Otherwise if you know how to do this with a different control, please let me know
Thanks
Quinton Carroll
I know what I know and I don't know what I don't know
|
|
|
|
|
Hi,
i am using a online dating site(a simple one). about images..is it good to store images in the database (ms sqlserver 2000) using ado.net
if yes i am continuing
my image uploads are working file now about managing images for user.
each user should be able to upload upto 5 images.
below are my codes
.aspx
----
aspx.vb
-------
Dim id As Integer = Request.QueryString("id")
objConn = New SqlConnection(dbPath)
Try
cmd = New SqlCommand("select * from userImage where userId='" + id.ToString + "'", objConn)
objConn.Open()
dr = cmd.ExecuteReader
'Dim img As Byte() = CType(cmd.ExecuteScalar(), Byte())
If dr.Read = True Then
Response.BinaryWrite(dr("bits"))
End If
Response.ContentType = "image/jpeg"
Catch ex As Exception
Response.Write("Oops what went wrong:" + ex.ToString)
Finally
objConn.Close()
End Try
--------
now the problem is
each image should have delete link which will actually delete the image and should be option like set image as primary pic.
in my aspx.vb if there is only one image rest of the images should be invisble instead of having img icon with no image.
please help me how to achieve this.
thanks in forward as i am just beginner in this area.
robin
|
|
|
|
|
Hi I solved it myself. there is building
|
|
|
|
|
Is it possible to run a vb.net exe file on Windows'98 OS?
What component have to load and where it is avaiable?
Regards
Suman
|
|
|
|
|
Hello
Yes you can.
Just install the .Net framework on the Windows 98 computer.
I dont know what windows 98 the .Net framwork is supported, but I am sure that in windows 98 SE it works.
|
|
|
|
|
Yes yes
Just install the .Net framework
|
|
|
|
|
Do we need to install Internet Explorer 6 or higher version, before install .Net framework
chatura
|
|
|
|
|
You're looking for the System Requirements[^] page on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Dont forget the Windows Intaller..
|
|
|
|
|
Yes it is possible to run vb.net exe files in Windows 98 , all you have to do is to just install the .Net Framework 1.1 or higher on this OS . You can download the .Net Framework for free from www.microsoft.com
|
|
|
|
|
Hello,
what I try to create is a .Net user control which can be used in VB6. Until now I wrote a class library with a .Net form and a COM class. This library I can use in VB6 without problems. But the creation of a user control seems to be a little bit more difficult. Has anybody done this before successful? Does anybody know or have a tutorial or an example for this?
Greets
Patrick
|
|
|
|
|
|
Public Class AdvanceLogon
Inherits CombinedDestination
<browsable(false)> _
Public Overrides Property ConnectionString() As String
Get
End Get
Set(ByVal Value As String)
End Set
End Property
End Class
when i complie the code, it gives the error ConnectionString is not overidable because it is a part of internal class of CombinedDestination class. How we can hide internal class property
kumar Prabhakar
-- modified at 5:06 Wednesday 8th March, 2006
|
|
|
|
|
To hide the member of base class, you can use shadows keyword.
Public Shadows Property ConnectionString() As String
Get
End Get
Set(ByVal Value As String)
End Set
End Property
!alien!
|
|
|
|
|
It does not hide ConnectionString in PropertyGrid of CombinedDestination Class.
abc
|
|
|
|
|
IIRC, you can't. You'd have to take that class out of the CombinedDestination class to do this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|