|
thanks Guffa. mycroft holmes that been lashin has ofcourse learn from my 'lazi'. i did not phrase the probem well. i need to be able to put all folders created by my application at the end of a month in a single folder( that is first day of july,sum for june). i have been able to get the logic like is
'Dim fd As New DateTime(DateTime.Now.Year, DateTime.Now.Month, 1)
'lastday = DateAdd(DateInterval.Month, 0, fd).ToLongDateString
'If Today.ToLongDateString.Equals(lastday) Then
the move here
endif
thanks once more for your advice
|
|
|
|
|
So, what you really want is that at the beginning of a new month, you want to move all the folders of the previous month?
Something like:
Dim today As DateTime = DateTime.Today
If today.Day = 1 Then
Dim t As DateTime = today.AddMonths(-1)
While t < today
Dim folder As String = t.ToLongDateString
If Directory.Exists(folder)
' move it
End If
t = t.AddDays(1)
End While
End If
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
I dont see any value property for button. When I convert VB6 application to VB.net, the code as follows
VB 6.0
Public Property Get VarArray(ByVal ctrl As Control) As String
VarArray = ctrl.Value
End Property
After converting to VB.NET
Public ReadOnly Property VarArray(ByVal ctrl As System.Windows.Forms.Control) As String
Get
'UPGRADE_WARNING: Couldn't resolve default property of object ctrl.Value. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
VarArray = ctrl.Value
End Get
End Property
Here VB.NET code is giving compilation error "Value is not member of 'System.Windows.Forms.Control'"
Please let me know how to do this.
Thanks in Advance,
AR Reddy
|
|
|
|
|
You could consider going through the trouble of inheriting System.Windows.Forms.Button to create your own button control that has a Value property, but that process, although not particularly difficult, may still not be necessary. Maybe you can simply manipulate the button's Tag property in .Net to emulate how you were using the Value property?
|
|
|
|
|
A couple things:
First, the property Value on a CommandButton in VB6 is a Boolean - not a string.
Secondly, In all of VB6's infinite wisdom, doing Call Command1_Click() has the same effect of setting Command1.Value=True in code. So, the only time VarArray in your VB6 code above would be true is when Command1_Click() is called.
If you are using RadioButtons or CheckBoxes, Value was replaced by Checked .
|
|
|
|
|
how can i retrieve end of day and end of month
|
|
|
|
|
Get the 1st day of the next month and dateadd -1
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how do i get the 1stday of the nextmonth
|
|
|
|
|
Add a month to the 1st day of this month.
Looking at your questions, I'd suggest getting the big reference manual called Google working for you - or give up programming as you don't seem to have any concept of researching 'problems'
Bob
Ashfield Consultants Ltd
|
|
|
|
|
thanks for your ctriticism. it have be useful
|
|
|
|
|
It was meant to be helpful.
If you are serious about becoming a programmer you need to be able to research problems yourself, rather than just posting questions to forums. Your questions about date manipulation are very basic and easily answered by looking at the Visual Studio help, or just typing into Google. What will you do if you have a production problem in the middle of the night, when an answer is needed asap? Post a question here and wait for possibly several hours for an answer or use BOL and Google and think for yourself?
As an ex Development Manager, prior to a face to face interview I would ask what forums a candidate was a member of, and their user name. I then checked on their postings. If I saw loads of simple questions and no serous replies I would not waste my time interviewing them.
That was my point, so your sarcasm was not appreciated.
BTW, your profile says you are in the USA so why ask
Ebube wrote: can someone tell which institute offer quality training in mobile application using vb 2008 in india
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Probably going home - dev manager found out his moniker
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi, im using VS2008 n working on windows appication,
here i have a problem, is it possible for me to draw a bitmap by pixel,
for example if i have 2x2 pixel bitmap, how can i set its color each pixel with different color? for example yellow,green,red and black..
please help me... give me any guide or the best reference for me to solve this..
|
|
|
|
|
Use the SetPixel method of the Bitmap class.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
ok, i have use the setpixel to draw one pixel now, but how about the next pixel, it will be replacing the color that have been draw before,
here my sample code for button click event:
Dim bmp As New Bitmap(PictureBox3.Width, PictureBox3.Height)
Dim gr As Graphics = Graphics.FromImage(bmp)
Dim A As Color
Dim i, j As Integer
i = 0
j = 0
Dim n As Integer
For n = 0 To ListBox1.Items.Count - 1
If ListBox1.Items(n) = "A" Then
A = Color.Orange
ElseIf ListBox1.Items(n) = "R" Then
A = Color.Red
ElseIf ListBox1.Items(n) = "G" Then
A = Color.Lime
Else
A = Color.Black
End If
bmp = New Bitmap(100, 100, gr)
bmp.SetPixel(i, j, A)
i = i + 1
j = j + 1
'gr.DrawImage(bmp, 10, 10)
Next
bmp.Save("C:\bmp.bmp")
how can i store the drawing untill it complete all process and then show them..
|
|
|
|
|
You are creating a new Bitmap object for every iteration in the loop, throwing away the previous bitmap, so only the last pixel will be present in the last bitmap. You should create only one Bitmap object.
And remember to Dispose all the Bitmap and Graphics objects that you create when you are done with them.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
In addition to the response you got, if you have a big bitmap, you should read my image processing articles for more efficient ways to set a LOT of pixels.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hi
Is there a possibility to specify for each webbrowser control an extra folder for the belonging temporary internet files ??
By now it is always the same folder as IE uses but at least i wanna store the data in an extra subfolder
Thx
|
|
|
|
|
No, there isn't. If you change the temporary folder, it's changed for all instances of IE and the Web Browser control.
|
|
|
|
|
|
help is a useless subject line.
Yes, of course you can. C# and VB.NET target the same runtime, so there's no reason you can't. You can even compile the control as a C# dll and import/use it in VB projects, or buy libraries that will convert it for you.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
ill try a better subject line next time lol
im only just starting out programming i have written basic things before but that was on quick basic and vb4 when i was about 9-10 im 19 now and the way things are done with these programs seems completely different anyway cheers for information
regards iain
|
|
|
|
|
Yeah, VB.NEt is a whole new language compared to VB6, etc. Much better, tho.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Christian Graus wrote: Much better, tho.
I agree. People need to become more aware of it, rather than smacking on it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Use a more meaningful subject line, rather than just help.
It shouldn't be that hard to rewrite in vb.net, but why?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|