|
' in ListBox1_DoubleClick
Me.TextBox1.Text = Me.TextBox1.Text & Me.ListBox1.Text & vbCrLf
Samir R. Ibrahim
modified on Saturday, February 7, 2009 1:38 PM
|
|
|
|
|
|
purva shekdar wrote: i need a code in visual basic 6 tat helps me to search all types of files in all drives of my computer
So, what are you waiting for?? Start writing it! Noone here is going to do your job for you.
Or, did you mean to ask a specific question about a problem you're having with YOUR code??
|
|
|
|
|
purva shekdar wrote: pls help me as soon as possible
Sure.
1 - stop using VB6, it was always crap and has been unsupported for a long time
2 - buy a book on VB.NET
3 - learn to use google and MSDN
4 - now the job is easy.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Noone is just going to hand you a completed project. YOU have to write it yourself. We can help with that part, but as for doing your job for you, forget it.
|
|
|
|
|
Hi Dave
I am new in forum, and I am still learning vb.net
I know vb6 (good) and I am Professional in Foxpro (VFP)
I am an active member on many foxpro forums, and I have my own blog for foxpro
I am telling that to ask a question
in foxite forum, if someone ask this question I can give him
#1 already posted message to his answer.
#2 a link to web page that solve his answer.
#3 a link to my blog that I had already write a document on this question.
Is the rule in here that you don't answer question posted if the person who post
the question did not make some effort?
I am with "make some effort, then post your problem if you get stuck"
Can you point please to #1 #2 #3 which are acceptable and which are not?
Sorry If I ask to much, I Just want to make sure I don't make wrong when posting Q or A
TIA
Samir R. Ibrahim
|
|
|
|
|
Samir Ibrahim wrote: Is the rule in here that you don't answer question posted if the person who post
the question did not make some effort?
Yes. There's just WAY too many "questions" asking for code. There's too much copy'n'paste coding going on in the world and too many "students" who just want their assignments done for them.
So, when someone asks for code, it's chances are VERY high that it's not to help them write their own code.
You can put up any answer you want. I've gotten so tired of "programmers" want their code written for them, they get the standard answer of "if you want code, WRITE IT!"
|
|
|
|
|
|
I think the other point is also that VB6 is no longer supported and you are doing NEW development in it. You originally asked for a solution, not guidance and to top it of you consider it urgent. It is only urgent to YOU.
These points will insure you get no help from the forum which is here to help, not supply code. Seriously, trash the VB6 and move to .net NOW
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you insist on using VB6, Google for "FileSystemObject". The logic is "recursive", so you may want to Google that too.
And yes, you asked for the code, not a push in the right direction.
|
|
|
|
|
hi all
i want to import calendar from app such as outlook and hotmail in to my program, which is a template of Diary
does any know how i can go about this or how i can create this in vb.net
|
|
|
|
|
Use the APIs/COM objects
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
i don't want to import it permanetly,it only for, when the user logs in their account in my program and want to view their calendar from hotmail for example,
|
|
|
|
|
I need to populate a combobox with a list of the past 20 years.
So I get
2009
2008
2007
...
I have
For x As Integer = Date.Now.Year - 20 To Date.Now.Year Step -1<br />
form.YearFromComboBox.Items.Add(x.ToString())<br />
Next
but the loop never runs in code. What am I doing wrong please (apart from being in charge of a computer )?
|
|
|
|
|
The first problem with the code, as posted is that your list will be reversed.
i.e. it will give
1989
1990
1991
........
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Of course. I've been staring at this darn thing for far too long today.
Thanks.
|
|
|
|
|
kanchoette wrote: I've been staring at this darn thing for far too long today
I know that feeling.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Dim X as integer
for x = Cint(date.Now.year) to (Cint(Date.Now.Year)-20) step - 1
YearFromCoomboBox.items.add(x)
next
|
|
|
|
|
Curious why you are using CInt for this? The Year property already is an Integer.
Or you should be consistent and convert every value:
Dim x As Integer
For x = CInt(Cdate(CDate(Date).Now).Year) to (CInt(CDate(CDate(Date).Now).Year) - CInt(20)) step CInt(-CInt(1))
YearFromCoomboBox.items.add(CStr(CInt(x)))
Next
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
For i As Integer = 0 To 20
MsgBox(Now.AddYears(i * -1).ToString("yyyy"))
Next
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
Don't call the Now method repeatedly, that is bad practice. In this specific case it's quite unlikely, but the reason is that the value returned by Now changes, so you can get different values from one call to the next. Get the value into a variable, and use the variable repeatedly.
When you loop from a higher value to a lower, you have to put the higher value first in the For statement:
Dim year As Integer = DateTime.Now.Year
For x As Integer = year To year - 20 Step -1
form.YearFromComboBox.Items.Add(x.ToString())
Next
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Gufa
See the code below
For I = Now.Year To Now.Year - 20 Step -1
Me.ComboBox1.Items.Add(CStr(I))
Next
I am not posting to show you my answer, but to ask you some question
I am still learning VB.Net so I am searching for answers
#1 You mention above in previous reply that using Now recursively is not best practice,
Can i know why.
#2 Is using .net convert function such as x.ToString is better than CStr(x) ? and why.
TIA
Samir R. Ibrahim
|
|
|
|
|
Thecaptin wrote: #1 You mention above in previous reply that using Now recursively is not best practice,
Can i know why.
The value returned from Now changes, so it could for example be 2008-12-31 23:59:59 when you call it the first time and 2009-01-01 00:00:00 the next. In your case there is a very low risk for this to happen, and it would only result in the wrong number of items in the list, but there are situations where this is much more likely to happen, and where it will have a much more serious result. That is why it's a bad practice to call the Now method repeatedly.
Thecaptin wrote: #2 Is using .net convert function such as x.ToString is better than CStr(x) ? and why.
The CStr function only does some type checking and then it calls the ToString method, so the difference it quite small.
Some will say that you should use the functions in VB, some will say that you should use the function in the framework. I lean towards the later. VB is now an object oriented language, so the Integer type has a method for converting it to a string. You don't need another function that in the end just calls the method in the Integer class anyway.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
Sorry for getting late to answer, I was in vacation.
Guffa wrote: The value returned from Now changes, so it could for example be 2008-12-31 23:59:59 when you call it the first time and 2009-01-01 00:00:00 the next.
That is a clever remark from your side, but my answer is "No Comment" because there is to many variables required which is necessary to use the new or old "Now" Value.
Guffa wrote: You don't need another function that in the end just calls the method in the Integer class anyway.
I had make some tests.
-As you said above, thet CStr is a wrapping function to .net ToString function. and from my test result, that is not true.
-I had made a 2 loop
Dim TimeStart, TimeElapse
TimeStart = Now.TimeOfDay
For I = 1 to 10000000
strTemp = CStr(I)
Next I
TimeElapse = Now.TimeOfDay - TimeStart
MessageBox.Show(TimeElapse)
TimeStart = Now.TimeOfDay
For I = 1 to 10000000
strTemp = I.ToString
Next I
TimeElapse = Now.TimeOfDay - TimeStart
MessageBox.Show(TimeElapse)
- I compare the execution time of both codes
- The result was they are in the same speed until counter "I" is over 1000000 when I is over, CStr is 17 to 30% faster than .ToString
Can you confirm?
if that so, then CStr is a VB Function and not in .net framework?
TIA
Samir R. Ibrahim
|
|
|
|