|
fair enough. Point still stands..
|
|
|
|
|
I want to remove the time from (2/6/2009 12:00:00 AM ).
I want to use only date without displaying the time (in vb.net)
|
|
|
|
|
|
Or
dateOnly.ToShortDateString()
|
|
|
|
|
I am using VB.net 2009. How should I bring my form to front. Right now I am able to restrict the user to open the duplicate instance only. But the already opened instance remains minimized. So sometimes , it leads to the confusion that the form is not getting opened and Actually it is already opened in minimized window state. If i changes the window state to maximized. Then it changes the window state also, Because sometimes, the window is in normal mode and is minimized also / the window state us in maximized and minimized mode . How should I resolve this issue?
Dim objInv As frmWaste = Nothing
For i As Integer = 0 To My.Application.OpenForms.Count - 1
Select Case Filename
Case "frmAdd"
If (My.Application.OpenForms(i).Name = Filename) Then
objInv = My.Application.OpenForms(i)
If (objInv .UserID = id) Then
objInv .Focus()
Return True
End If
End If
End Select
Next
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Before you set the Focus, try checking the WindowState and if it is minimised, set it to Normal.
Pankaj Garg wrote: if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
I have no idea!!!
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
There's no such thing as VB.NET 2009. It's 2002, 2003, 2005, or 2008... and soon to be 2010.
|
|
|
|
|
Sorry, I Meant 2008
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
hi.....
i did one commercial project in vb.net...... i just want to display my billing details as report form..... i am having some listview content and some field obtained from access database..... i want to view this as in my report and i want proper alignment too...... how to pass my listview content to crystal report...... and also i need how to use crystal report in vb.net
|
|
|
|
|
refer following link
Crystal Report[^]
above search generate a list of article which is helpful for you
|
|
|
|
|
Firstly there are several ways to pass data to Crystal, including using a Typed DataSet which could be used with your ListView and your Crystal Report.
<blockquote class="FQ"><div class="FQA">NaliniNagarajan wrote:</div>and also i need how to use crystal report in vb.net</blockquote>
You really should buy a book as Crystal Reports is a very large subject in its our right.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hello
I'm written an application using VB 6 to remote workstation, such as restart, shutting down and locked it.
Till now I'm still looking how to do that then I read your mail.
If u don't mind would you share with me, the code sample or what ever it is, thanks a lot before..
Regards Bono,
|
|
|
|
|
Try replying to the thread this equates to. Who is this aimed at?
You need to look into DCOM, but really you should not be using VB6, you should be using VB.NET and remoting.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
bono from indo wrote: I'm written an application using VB 6 to remote workstation,
bono from indo wrote: If u don't mind would you share with me, the code sample or what ever it is, thanks a lot before..
So, you are writing an application, but you want others to give the code samples to you. Correct me if I am wrong, but doesn't that mean, you are not writing that application at all but somebody else is? So... it's not your problem any more, but somebody else's and your request is therefore redundant. Wasn't that nice and easy?
|
|
|
|
|
I make a software in vb.net which is used multithreading
I want to Synchronization of threads so that multiple thread cannot be able to access same code at the same time ................
Thanx!!!!!
|
|
|
|
|
Without all the description that a question like this needs to be clear, I think you may need to look into using a SyncLock.
' Locks a section of code so only one thread can run it at a time
SyncLock lockObject
' Code
End SyncLock
The documentation on SyncLock can be found here[^]. The hardest part about using it is picking an appropriate object to use for the lock.
|
|
|
|
|
By "Same code" I assume you mean the same variable- each thread has its own copy of the code. Take a look at synclock, that does what you need.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Alright so I am just starting to learn VB and ran into a snag. This assignment is due tomorrow and I cannot format this correctly. In the image bellow, The top running program is my program which is run by the code in the background. The bottom running program is my teachers example of how things SHOULD work. All the formulas and math is correct so no issue there. The two obvious problems is the formatting and decimal placement. I cannot for the life of me figure out how to get the numbers to round to the nearest tenth. As for the formatting I cannot get everything to line up correctly like my teachers. Can anybody help me fix these small issues? I really appreciate any help I can get. Thank you.
Also the source Code is placed below the image link
Private Sub btnBill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBill.Click
Dim frmStr As String = "{0,-10}{1,30:N}"
Dim cust, d1 As String
Dim a, b, sum1, sum2, sum3, sum4 As Double
a = CDbl(txtHour.Text)
b = CDbl(txtPart.Text)
sum1 = a * 35
sum2 = b * 0.05
sum3 = b + sum2
sum4 = sum1 + sum3
cust = txtCust.Text
d1 = "$"
lstOutput.Items.Clear()
lstOutput.Items.Add(String.Format(frmStr, "Customer", cust))
lstOutput.Items.Add(String.Format(frmStr, "Labor Cost", d1 & sum1))
lstOutput.Items.Add(String.Format(frmStr, "Parts Cost", d1 & sum3))
lstOutput.Items.Add(String.Format(frmStr, "Total Cost", d1 & sum4))
End Sub
|
|
|
|
|
You're on the right track. What you need to do, is read the documentation on format strings - you can specify the number of decimal places in your format string. And, I assume you can specify the alignment of items in the listview via a property.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I Figured as much for the decimal Places I just still don't know what property or even where to put it. As for the format, I don't know what property I would use or wear to put it either. Basically with these two I am stuck. Do you know the properties I would need to use and where to put them?
|
|
|
|
|
Hi shawndeprey;
The code below will correctly format the strings. The other issue you will have is that the font assign to controls by default are not monospace font meaning that each character will have a different width and therefore will never line up. What you need to do is go to the property page for the control and change the font of that control to a monospace font. One such font is Consolas. Once you have made this and the code change it will line up.
' You need two format strings one that has all text
' One that has currency values at the end.
Dim headerStr As String = "{0,-10}{1,30}"
' The C in the format string formats the number in
' currency format, $999.99, no need to add $ to string
Dim frmStr As String = "{0,-10}{1,30:C}"
Dim cust As String
Dim a, b, sum1, sum2, sum3, sum4 As Double
a = CDbl(txtHour.Text)
b = CDbl(txtPart.Text)
sum1 = a * 35
sum2 = b * 0.05
sum3 = b + sum2
sum4 = sum1 + sum3
cust = txtCust.Text
lstOutput.Items.Clear()
lstOutput.Items.Add(String.Format(headerStr, "Customer", cust))
lstOutput.Items.Add(String.Format(frmStr, "Labor Cost", sum1))
lstOutput.Items.Add(String.Format(frmStr, "Parts Cost", sum3))
lstOutput.Items.Add(String.Format(frmStr, "Total Cost", sum4))
Fernando
|
|
|
|
|
PERFECT!!! I changed to font to Courier New and presto! Thanks Bunches Fernando.
|
|
|
|
|
Not a problem, glad I was able to help.
|
|
|
|
|
|
Hi,
did you create subitem(10) before you tried to assign some text to it?
array elements need to be created before they can be operated on, same as simple objects: create first, then use.
How about ...items(5).subitems.add(something)
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
|
|
|
|