|
Samir Ibrahim wrote: That is a clever remark from your side
In what way do you think that it's clever?
Samir Ibrahim wrote: but my answer is "No Comment"
As in "I'm in to it up to my ears, and in that situation it's best keep your mouth shut"?
Samir Ibrahim wrote: because there is to many variables required which is necessary to use the new or old "Now" Value.
That doesn't make sense... What variables are you talking about?
Samir Ibrahim wrote: - 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?
Of course not. With as few iterations as you used, you are way below the resolution of the system clock. you should use something that gives a better resolution:
Dim w1 As New Stopwatch, w2 As New Stopwatch
Dim strTemp As String
w1.Start()
For i = 1 To 100000000
strTemp = CStr(i)
Next i
w1.Stop()
w2.Start()
For i = 1 To 100000000
strTemp = i.ToString
Next i
w2.Stop()
TextBox1.Text = String.Format("CStr: {0} ms., ToString: {1} ms.", w1.ElapsedMilliseconds, w2.ElapsedMilliseconds)
Result of my test run:
CStr: 12487 ms., ToString: 11406 ms.
According to your test, CStr should be 17-30% faster, but instead ToString is about 9% faster. This is consistent with the code that is generated. If you take a look at the code in .Net Reflector, you see that this statement:
strTemp = CStr(i)
actually compiles into this code:
strTemp = Conversions.ToString(i)
If you look at the Conversions.ToString(Int32) method, it looks like this:
Public Shared Function ToString(ByVal Value As Integer) As String
Return Value.ToString(Nothing, Nothing)
End Function
If that's not a plain wrapper for the Int32.ToString method, I don't know what is...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: In what way do you think that it's clever?
You take care of the possibility that the date could change during this time of period "31/12/2008 11:59:00" when using Now() in a function.
Guffa wrote: hat doesn't make sense... What variables are you talking about?
I mean Variation and demands to this application if it need to use the new Now() Value or still using the old Now() value. In some situation you need the New Now() value to be presented in the function you are creating and in sometime that is not important.
Guffa wrote: Dim w1 As New Stopwatch
Thank you for this new Info
Guffa wrote: CStr: 12487 ms., ToString: 11406 ms.
With your code, I had the same result but, with different numbers
Guffa wrote: If you take a look at the code in .Net Reflector,
I heard about .Net Reflector, never use it or know what is this used for.
Do you notice that all my question ends with ? because I am not sure. I am still learning vb.net 2 Month old ,so don't be hard on me
Thank you very much for your time and enplaning. very appreciated.
Samir R. Ibrahim
|
|
|
|
|
If my 2 group boxes are next to each other on the form, all is well.
If the 2 group boxes are one on top of each other, however, the button2 code doesn't work. Groupbox1 is hidden, but Groupbox2 never shows.
Anyone had this problem? Is there a way to put the groupboxes on top of each other and show/hide them properly?
Thanks
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
GroupBox1.Show()
GroupBox2.Hide()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'GroupBox1.SendToBack()
GroupBox1.Hide()
GroupBox2.Show()
'GroupBox2.BringToFront()
End Sub
|
|
|
|
|
hi
have you try to use GroupBox1.Visible = True/False
instead of Hide()/Show()?
regards
|
|
|
|
|
Yes, tried that too. There's something odd about groupboxes. Even in the form editor, if you drag them on top of each other they tend to disappear. Other controls don't do that. I'm thinking it's a bug perhaps, but I can't find a workaround.
|
|
|
|
|
I am trying to create an "options" screen for my program in which i have a treeview on the left and a when you select a node in the treeview the corresponding groupbox will show on the right with the settings for that category. The problem I am running into is the groupboxes embed themselves into one another when you put them on top of one another. I need like 10 of them on top of each other and this is really frustrating me.
I have tried locking the groupboxes, but that does not work. I noticed you have to place them just right (just offset of the one below it) or they embed. Of course the groupbox has border lines you can't get rid of so you see them moving as you make your way thru the treeview. Not good!
Like you state above, the groupbox will not appear. I am guessing this is because it is now embedded into the groupbox below where it was placed.
modified on Sunday, January 3, 2010 8:38 PM
|
|
|
|
|
Hi All,
I am working with Vb 6 and I want a Crystal Report that should include Page Wise total amount, and in Final Page it should display the Grand total amount.
Anybody can suggest how to get it.
Thanks in advance.
|
|
|
|
|
if anyone know about file recovery?
i need file recovery project in vb.net
|
|
|
|
|
|
EliottA wrote: where did you start?
in the recycle bin of course, that's where those lost files have been seen last.
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
|
|
|
|
|
Unless you know how the NT File System works internally, you're going to find this project impossible.
|
|
|
|
|
If you're targeting the FAT32 file system, then I think (but don't call me on this) that there's some form of backup built in to the file system. Alternatively, start from sector 0 of the disk, and walk the clusters until you find a file which isn't in the file system's list of file pointers
Either way, this is too advanced for VB.Net alone. You would need a hook of some sort into C++, and use the windows api from there
|
|
|
|
|
Hi,
I have DataGridView control inside a tab in a TabControl container. I have set the Selection BackColor of the grid to transparent because I don't want the rows to be coloured when selected. Now, the problem I have is that when after populating the grid, the selected cell, which I have specified, is transparent but it is showing the contents of another tab, i.e. not only is the cell row selection color transparent but the grid and current tab are also transparent. When I click out of that cell and then return, it displays correctly.
Anyone else have a similar experience?
|
|
|
|
|
pls i need anyone who can assist in getting the codes and understand the concept behind finger print security door using VB. Net programming language
|
|
|
|
|
Never heared of Google? Took me only 3 seconds to type in what i was searching for and 0.17 seconds for google to find.
try this[^]
the word is "please", by the way, not "pls"
|
|
|
|
|
Hi all.
I'm beating my head against the wall here, and I know there is a simple solution. I apparently can't find it no matter what I try.
I need a combo box that I can place some ghost text on that says "enter your search here" that will disappear when the user begins to type.
I've found how to do it in WPF, but I need a version for Net 2.5 also.
a simple owner draw won't work, as it looks like heck in Vista....
Thanks,
Tom
|
|
|
|
|
shoorrock wrote: but I need a version for Net 2.5 also.
No such thing.
shoorrock wrote: a simple owner draw won't work, as it looks like heck in Vista....
Just set the initial text, handle the focus event, and clear the text if that's what it is.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
I'm not sure what you're asking - how to change what textbox is getting the input ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am sorry i didnot explain proply. Problem is only 1 textbox is workig. The other textbox didnot get the fouce. I am talking about virtual keyboard on screen. I can make only one textbox can get a focus. the other textbox did not get fouce. how to make the other textbox is making focus by enter button on screen after 1 textbox input done.
thank you for your concern.
|
|
|
|
|
Try the KeyPress event of your first textbox:
If e.KeyChar = Chr(13) Then
TextBox2.Focus
End If
and if that works, use the same trick with the others.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thank You for your advise
I did it your advise, but It did not working
do you have another idea..?
Thank you your Reply
|
|
|
|
|
Could you try and explain a little clearer, what it is that you are trying to do?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Obviously, you have to send the return character if you want it to change the focus. Perhaps what you need is to understand the answers being given enough to understand that setting the focus of the next textbox is your solution, and that when you're given a solution, you should explore/try to understand it, instead of saying 'do you have another idea', which equates to 'give me another snippet I can try to use without learning anything'.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
woca4u wrote: I try to make virtual keyboard
If you are trying to make a virtual keyboard , you can directly send the keys to the system , instead of sending it to a specific textbox , For sending key to current active application use SendKeys.Send()
built in VB. Also it you want to send the key directly to OS use kybd_event win32 API (using Win32 API is bit tricky), Let me know your choice , if SendKeys.Send() works for you its ok , other wise we can think of using Win32 API
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|