|
LFlindall wrote: I guess it isn't as simple as adding a library reference to user32.dll and call in the appropriate methods to get me were I want to go..
Oh no. FAR from it!
|
|
|
|
|
Hi,
I have read all items from one listview and I have stored this in another listview. However I want to use one item as group name in 2nd listview. I am able to show all items in 2nd listview but no group headers. I wonder why groups doesn't show up in 2nd listview. Where do I make mistake? All the items are getting listed under default group header.
Thanks.
Private Sub BasketOnCounter()
Dim LCounter As Int32 = 0
Dim Found As Boolean = False
ListView1.BeginUpdate()
'Here we create groups with Artist names
For Each BasketItem As ListViewItem In Form1.ListView6.Items
Found = False
If ListView1.Groups.Count > 0 Then
For Each ArtistItem As ListViewGroup In ListView1.Groups
If ArtistItem.Header = BasketItem.SubItems(0).Text Then
Found = True
Exit For
End If
Next
End If
If Found = False Then
Dim SetGroupName As New ListViewGroup
SetGroupName.Header = BasketItem.SubItems(0).Text
SetGroupName.HeaderAlignment = HorizontalAlignment.Left
ListView1.Groups.Add(SetGroupName)
LCounter += 1
End If
Next
'Here we add items in listview
LCounter = 0
For Each BasketItem As ListViewItem In Form1.ListView6.Items
Try
ListView1.Items.Add(BasketItem.SubItems(1).Text)
ListView1.Items(LCounter).SubItems.Add(BasketItem.SubItems(3).Text)
ListView1.Items(LCounter).SubItems.Add(BasketItem.SubItems(2).Text)
ListView1.Items(LCounter).Group = ListView1.Groups(BasketItem.SubItems(0).Text)
'When I enable the following line the VS2008 is crashing.
ListView1.Groups(BasketItem.SubItems(0).Text).Items.Add(ListView1.Items(LCounter)) here
Catch ex As Exception
MsgBox(ex.ToString & " " & BasketItem.SubItems(0).Text)
End Try
LCounter += 1
Next
ListView1.EndUpdate()
End Sub
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
What's the error that it comes up with??
Did you Enable Visual Styles in your Project properties?? Without it, Grouping will not work in the ListView.
|
|
|
|
|
I enabled the visual styles. I am getting a system null exception error message. I double checked to make sure that Listview has the groups. However during adding and item and then assigning a group to item suppose to list the item under the specified group. The list view list all the items under the default group.
I think I have forgotten something but no idea what it is. The problem is still persit.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Alright I am making a program for class and my problem is in the 2nd and 3rd parts to my code. The second block is a loop to read stuff from the text file and output it in the lstDisplay. My promlem is I have to figure out a "final total" as seen in the third block. Since the loop redifines the DIM'S "name, rate, hour, and gp" I cannot figure out my total amount. I basically need to add up all the gp's to find my total, however, Since it loops when it gets to the point of my total amount gp obviously only has 1 value which is the final value read from the text file. What could I do to fix this problem and come up with my final value?
Public Class frmPay
Private Sub btnPay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPay.Click
Dim sr As IO.StreamReader = IO.File.OpenText("6-PP-1.txt")
Dim dates, name, rate, hour As String
Dim gp As Double
dates = sr.ReadLine
lstOutput.Items.Clear()
lstOutput.Items.Add("Payroll Report for week ending " & dates)
lstOutput.Items.Add(" ")
Dim headerStr1 As String = "{0,-10}{1,15}{2,15}{3,15}"
Dim headerStr2 As String = "{0,-10}{1,15:C}{2,15}{3,15:C}"
lstOutput.Items.Add(String.Format(headerStr1, "Employee", "Hourly Rate", "Hours Worked", "Gross Pay"))
lstOutput.Items.Add(" ")
Do While sr.Peek <> -1
name = sr.ReadLine
rate = CDbl(sr.ReadLine)
hour = CDbl(sr.ReadLine)
gp = CDbl(rate * hour)
lstOutput.Items.Add(String.Format(headerStr2, name, rate, CStr(hour), gp))
Loop
lstOutput.Items.Add(" ")
lstOutput.Items.Add(String.Format(headerStr1, "Final Total", " ", " ", gp))
sr.Close()
End Sub
End Class
Thanks for the help,
Shawn Deprey
|
|
|
|
|
Hi,
if all you need is the overall total, why not just accumulate while you are enumerating the items, hence put totalGP = totalGP + gp inside the while loop; you need to declare and intialize your accumulating variable before entering the loop. This is elementary; wouldn't you rather buy and study a programming book?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I am just starting to learn visual basic. This VB class is my first attempt at coding. Even if it is elementary in the world of high level programming languages. I have to start somewhere I guess.
As for your advice I THINK I understand what you said however I cannot modify my files on the computer I am using so I will test them when I get home in an hour. Thank you for the speedy response Luc!
|
|
|
|
|
Hi Its Shawn again. I first declaired totalgp as a double and put it just outside the loop and then realized how the looping would continuously add gp to total gp if it were inside the loop like you said. You have been a tremendous help. TYVM!
Shawn D.
|
|
|
|
|
Hi, I am working in a Startup company as a Software Engineer.. Actually we are planning to do an ERP application in VB.Net and back end as SQL Server 2000.. Can any one please suggest me that which language is preferable to develop that application...
Thanks in advance,
Victoria
VB.Net
|
|
|
|
|
Well you have ready stated VB.NET although I would suggest you use VB.NET 2008 if you are developing with VB.NET. I would also question the use of MS SQL Server 2000. Sure 2005 or even better 2008 should be your perfered back-end.
An ERP System is a very ambishous project, especially considering you will be competing in a market dominated by the likes of SAP, Microsoft, SunSystems and may other large companies.
If I was a protential dragon investor in your company (see Dragons Den), then I would be saying "I'm out !!!"
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Thanks for ur reply..
can i use MySql as backend DB instead of SQL Server..
Thanks in advance
Victoria
VB.Net
|
|
|
|
|
Yes, but you would need to use the System.Data.OleDbClient namespace rather than the System.Data.SqlClient namespace.
Also read the licensing document for MySQL. If you intend to use it commercially, it's not free, were as MS SQL Server Express is, but has limited functionality, but is easy to migrate to full MS SQL Server at a later date.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
wr3028 wrote: which language is preferable
* VB.NET, as you already have in-house knowledge of that language. It only needs to be converted to cash
* ANSI SQL, keep your query's simple and understandble
* English, for the much needed documentation.
If you come at a point where VB.NET "feels" insufficient, rest ensured that you can mix in some C# or even C++, without any hassle
You guys got a blog running?
I are troll
|
|
|
|
|
hi all
i have a datagridview in which i have manually bounded columns(in runtime)
i want to talk the print out of this datagridview and also need to transfer it into excel
plz tell me how to do this.
I am using vs 2008 window application.
thanks in advance
Er. Jagwinder Singh
|
|
|
|
|
|
is this the answer??
Er. Jagwinder Singh
|
|
|
|
|
What are you expecting? Source code?
You have ended up in wrong place then.
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
|
|
|
|
|
Did you click on the links to see what they came up with?? Did you go and read some of the articles in those lists??
Come on. You're apparently expecting to be spoon fed the answer, when he's actually telling you how to do the research yourself. Which is the more important skill to have??
|
|
|
|
|
sorry bro's
i m very sorry bro
the link send by use are useful for me.
sorry again..i will not repeat this
thanks for ur help
Er. Jagwinder Singh
|
|
|
|
|
Dunno, that seems to be a good answer to me.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi there.
Currently i have the following relationship between tables http://img230.imageshack.us/my.php?image=datarelations.jpg[^] . What i want to do is very simple but somehow i'm not getting there... when i'm inserting or searching for an element in the table "Produtos" ,instead of showing the Code from table "Produtos_Sectores" i want to show the name which is in the table "Sectores"..
Anyone knows how?
Thanks in advance.
|
|
|
|
|
i bought smart card with ominikey reader.the reader came along with drivers,some c++ header files and sample codes written in v.b 6.0.i have tired running the sample it keeps giving me error 53.scandll file can not be found.i will like to write and read from the card using c# or v.b .net.can i convert the codes to dot net and what can i do to write and read from the card.
|
|
|
|
|
Is the scan.dll file in the same folder as the .EXE you launched to run the demo?? Is it in C:\Windows\System32?? If not, you can get this error.
fresh2g6 wrote: can i convert the codes to dot net
That depends on your skill reading VB6 code and knowing how to translate it into VB.NET. If your skill level is pretty low, then I'd say you have to learn how VB6 and VB.NET work so you can convert the code.
fresh2g6 wrote: what can i do to write and read from the card.
That's covered by the documentation that comes with the SDK you got with the device. Noone here, or anywhere else for that matter (except the manufacturer) is going to know this off the top of their head. What you have to do, and possibly step-by-step examples, is going to be covered in the documentation for the libraries you got.
|
|
|
|
|
i am new when it comes to working with smart cards.Any way thanks for the reply.the reader API can now detect the card but the documentation do not cover the with the classes that writes and read from the card.i just want to know how to interface my program to the reader.from the ominikey documentation
|
|
|
|
|
The .NET Framework doesn't have any classes that deal with SmartCards.
You'll have to examine the source code for the VB6 app you have and start converting it to VB.NET.
|
|
|
|