Jump to content
Xtreme .Net Talk

snarfblam

Leaders
  • Posts

    2156
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by snarfblam

  1. In VB you may include double quotes inside a string by putting double double quotes. Better yet... let me show you: Dim A As String = "String with ""Quotes"" inside" 'A = String with "Quotes" inside Dim B As String = """Quotes at the beginning and end can look confusing""" 'B = "Quotes at the beginning and end can look confusing" Dim C As String = "<table width=""500"" border=""1"">" 'C = <table width="500" border="1">
  2. I just tried this with the string you provided ("2/10/2005 11:49:45 PM") and others with the same format. I converted it to a DateTime using both System.Convert.ToDateTime() and DateTime.Parse(), and both ways it properly converted to a DateTime, retained both the date and time data, and compared properly with DateTime.Now(). Perhaps you should post some code. I am not experiencing any of your problems. I don't know if this may help, but try looking at the overloads for DateTime.Parse().
  3. I had been using the printscreen/mspaint method for a while and still do from time to time. I'm sure you can find and download free image libraries from the internet, however, or find a program to extract icon resources from program files (provided that you do not violate any copyright laws of course). I have one called GetIcons.exe. Search download.com for it if you wanna try it. If you are looking for some sort property or function that throws an "open" icon on a button, however, there is no windows API or standard image function of any kind available to us, so though your method of obtaining the image may not be ideal your method for using a "standard" image on a button is right on. Unfortunately, as far as Windows itself is concerned there really are no standard toolbar icons like there are messagebox icons.
  4. Yeah... I would love to try and help but I don't quite know what a roll bar is. I even googled it and came up with nothing computer related.
  5. The method used to pause it really depends on how you are implementing this program. If you are using some sort of timer, you could stop it to pause and start it to unpause. In any other situation I can think of Diesel's solution would work fine.
  6. You need to include any listed parameters in a function call unless they are explicitly defined optional [they will appear in square brackets in intellisense], in this case buffer, offset, and count, which means you will also usually need to understand the purpose of each parameter. More importantly you need to pay attention to types. The function is asking for something as type byte(), or an array of bytes, which a String is not. When you call a function you must pass the information (i.e. arguements, parameters, etc.) of the correct type. Although depending on some options VB will automatically convert a few types of data for you, for the most part you need to make these conversions explicitly. As you get more experienced with .Net you will learn how to convert data to and from more different types. ASCII is one form of encoding text (i.e. storing a binary representation of text in the computer's memory). The System.Text.Encoding.ASCII.GetBytes() function returns the raw binary data of your text using ASCII encoding (in the form of a byte array: Byte()). If any of that went over your head, don't sweat it. All you really need to understand is that System.Text.Encoding.ASCII.GetBytes() converts data from the type you have (String) to the type that SerialConnection1.Write() reqires (Byte()).
  7. I'm not sure that closing Explorer is the best recommendation. If your pc can't handle Explorer you need to buy or build a new computer. Really. Anyways, if your using regular sdr ram you can usually buy more cheap. DDR is a different story (once I bought a gig off some website for over $100 and it didn't even work). Changing other settings can help too. Like I said, minimize background processes. Go to your task manager, see what is running, and uninstall the programs listed under your username that you don't use. Try to optimize page file usage (if you know what your doing). You might want to try turning off visual effects in windows (I don't think these will really slow your computer down and VS doesnt use them, but you never know). And if you really are desparate... Sure! Use notepad and compile through a command window.
  8. I kinda wonder why they implemented a directory.move and not a directory.copy...
  9. You can try to shadow the .Size, .Width, and .Height properties and in the .Resize event handler if the size is not what it should be then re-resize it back to the correct size. Unfortunately I don't know of any "proper" way to achieve the results you want, but I have done this in VB6 in the past to do the same thing.
  10. Yes, the amount of chars will vary unless you use a font where the chars have a fixed width like courier new or lucida console, in which case you can use the Graphics.MeasureString() function to figure out how many chars you can fit.
  11. What sort of trivia questions are there in these sample quizzes? My guess is that it may not seem particularly relevant now but as you become more familiar with the language or specific concepts you are studying it will help you produce simpler more effective code. Of course I really can't say for sure since I have no idea as to what your programming experience is or what sort of trivial questions they ask in the sample quizzes.
  12. Granted I have a lot of RAM, but I often find myself with visual studio .net, vb6, photoshop, 10 web browser windows, 3 instances of Paint, Winamp, and four folders open (give or take a few folders and broswers) and my computer's performance is still acceptable. I have a gig of RAM now but it doesnt really run much better than it did when I had 512 megs. My question to you is what do you have running in the background on your computer? My brother's computer has hardware about as fast as mine but big programs (live VS) runs so much slower because it is loaded up with so much junk from the makers of the computer.
  13. Appearently you guys are discussing MSDN right now but I just wanna say this about the VB6 to VB.Net transition. A while back after programming with VB6 for some time I started learning c++. It didn't last long because I missed my RAD and good ol' InStr() (string manipulations got the best of me in C++). But I found myself missing so many aspects C++ even after only a month of programming in it. To me C++ (and even C#) make alot more sense then VB6 ever did, but it was easier for me to stick with VB where I could whip up quick apps in minutes. Even so I still find myself declaring structs and int X instead of Types/Structures and Dim X As Integer. (As a matter of fact, more than once I spent several minutes trying to figure out what was wrong with my syntax when I declared a struct.) Anyways, when I got VB.Net I spent days just marveling at such nifty features as full OOP and Logical form control (no more unload me and showing forms without declaring and instantiating them) and incredible new operators like bitshift and shortcircuited logical operators and oh! Strict typing! I didn't notice any of the missing VB6 features. It seemed like they removed so many things wrong with VB and added so many things that should have been there all along. I was personally very confused by commands such as form1.Print when print was not even a member of the form class and crazy irregular syntax of a few functions like Line. Sure it took some time to adjust. I had to learn how to use the graphics class, I had to relearn how to manage forms and at first all the explicit casts and conversions seemed to get in the way, but now the code makes so much more sense and the classes involved are so much more useful. Of course VB.Net is not perfect. I'm not happy about the fact that sometimes people need to download the rather large .Net framework to run my programs and in my personal programming experience JIT compilation is really unnecessary 99 out of 100 times but in my (amateur) experience VB.Net is simply so much more productive and logical. My only regret is that I bought VB instead of C#. Any of you other VB users can call me crazy but I like C syntax better. Even if I always forget to close my brackets. And the second equal sign.
  14. Have you tried fully qualifying the class name? I haven't tried importing the namespace but I declared a variable of type system.reflection.assembly and had no problem.
  15. The thing about the textbox is that when the text is changed the caret doesnt move to the end. There is no caret. The SelectionStart property is set to -1, signifying that the caret isnt anywhere i suppose. So you need to move the caret to the location that you want to be visible.
  16. Isn't it considered very bad practice to store data in an executable file? I don't believe that .Net would provide any tools with such functionality [Edit]For the sake of clarity: I don't mean store data as in storing resources but saving user data or settings[/Edit]
  17. Good point. I supposed it depends on why you are repeating strings or chars. If it is something simple then there is nothing wrong with concatentation. If you are creating hundreds or more strings in such a fasion (im at a loss for any possible reason) or the strings are excessively long and great in number then yeah, go with string builder.
  18. Oh, well, sorry. That i can't help you with. Perhaps you could list the dates in a listbox and when the user clicks on of the dates it selects it in the datetimepicker. Otherwise I don't beleive that such a feature is available with the datetimepicker.
  19. yes.. provided that the situation for which he is making the program allows him to do it that way. what if he wants to enter an expression and apply the order of operations. If you open the windows calculator and enter [3] [+] [4] [*] [2] you get 14. If you ask ms script what "3+4*2" equals you will get 24. Granted you can sort the rules of operation out for yourself with a simple calculator but its much easier for the user if they can type the expression in as-is and use their brain as little as possible.
  20. What an amazingly simple solution. Don't know why I didn't see that myself... thanks
  21. Um... the fact is that when you use the Standard flatstyle, the .Net framework is rending your button and when you use the System flatstyle, windows is rendering your button. The difference is between who is rendering it, not the fonts. If you say that it is off center only when it is too long, it may be a minor bug in the .net framework, and yes, this may only occur with certain fonts or by something like roundoff error when cleartype is on or something. My guess is that it is always slightly off center (again, perhaps only with certain fonts) and the off-centerness is only noticable when the string is long enough that it reaches close to the left and right edges of the button.
  22. Parse the date into the Date data type if you need to and then set the DateTimePicker's .Value property to your Date. Easy as pie.
  23. The string constructor and padleft functions should word for repeating characters. For repeating strings why not just use a for loop that concatenates the string repeatedly?
  24. its really pretty simple. Assuming your textbox is named txtRecord... Dim gTextBox As Graphics = txtRecord.CreateGraphics() If gTextBox.MeasureString("", txtRecord.Font).Width > TextBox.Width Then 'Do what you need to do End If [/Code]
  25. Ok, i checked and that folder has no dlls in it (is it supposed to). Not to mention i didnt have to browse before. Oh im confused.
×
×
  • Create New...