Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. No, I don't think so... what happens when you don't have that line in there, specifically?
  2. Oh. If you do the following:TextBox1.SelectionStart = TextBox1.Text.Lengthit should take you to the end.
  3. If you have Option Strict on, then you need to cast objects to their correct types before using them. For example, Context.Cache("strArray")actually returns an Object, which you need to cast to ArrayList before it is usable.
  4. It does that already... maybe I'm just misunderstanding your question? When you type to the end of a one-line textbox, the text will scroll to the left and keep the caret visible.
  5. It should be separate from any other classes.
  6. To scroll to bottom: TextBox1.SelectionStart = TextBox1.Text.Length TextBox1.ScrollToCaret() To make text start from the bottom you'll need to write your own buffer control from scratch, because the textbox doesn't support it. If it's not required, I wouldn't bother, as it's a lot of work. To change the color of a readonly textbox, change the BackColor and ForeColor properties accordingly.
  7. You don't need to put the Structure *inside* the collection class. Other than that, it looks like it should work.
  8. You can make a strongly-typed collection by making a class which inherits CollectionBase and then overriding the Item property, the Add method, and the Remove method (those are the bare minimums - you can override other things too, like the Contains method too) and making their parameters and return values TransactionHistoryStructure instead of just Object. Here's a sample of a strongly-typed collection which only accepts Product object: Public Class ProductCollection : Inherits CollectionBase Public Function Add(ByVal obj As Product) As Integer Return Me.List.Add(obj) End Function Public Sub Remove(ByVal obj As Product) If Me.List.Contains(obj) Then Me.List.Remove(obj) End Sub Default Public Property Item(ByVal index As Integer) As Product Get Return DirectCast(Me.List.Item(index), Product) End Get Set(ByVal Value As Product) Me.List.Item(index) = Value End Set End Property End Class
  9. You might want to look into using XPath, the XML querying language. Check out the [msdn]System.Xml.XPath[/msdn] namespace.
  10. No, not really. Just read in the MSDN. It tells you all about it in there.
  11. Methods are called by you manually when you want to cause something to happen. Events are fired from within the class, and are used to handle certain actions. For example, in a socket class, you may have a Connect method, which *you* call in order to connect, and then a Connected event, which is called by the class when the connection is complete. MSDN contains tons of stuff like this. Open it and start readin'. :)
  12. I don't think establishing the connection is not what takes time. It is sending the request (the HTTP header) and recieving the data. You could try using sockets to manually connect to the server and send the HTTP header manually without disconnecting each time, but I'm not sure you can do that, or that it will help you much.
  13. Not without creating some sort of custom shape control, which would utilise the GDI+.
  14. Volte

    Dll

    If you are planning on fully supporting Linux, and you write in C or C++, you will need to write versions for both OS (due to differences in system calls and such). If it is a very simple DLL, however, it will probably compile as-is on either OS. If you write in .NET, there is the possibility of some inconsistencies, but if the framework implementation is written well, the code should compile. It's up to you.
  15. Of course it will take time to download them all. Even if it takes only 1 second to download the info for each stock, it will take 500 seconds, which is approximately 8 minutes and 20 seconds. So no, there's no faster way to do it than to get a really really fast internet connection. :p
  16. Interfaces are different. They are basically prototypes for entire classes. There's no real way that you could substitute and interface in this case.
  17. You don't need to worry about calling conventions in C#, since you can't export functions like that. However, you will need to learn how to use delegates. You need to create a delegate called func, which accepts one byte parameter (to match your Func typedef): public delegate void Func(byte b);This is sort of a prototype for a function. You then need to place it in your function's parameter signature: public myFunction(byte id, Func f) { // code here }You then have to create a function which matches the signature of the Func delegate, and pass that to your function. So: public delegateFunction(byte b) { // matches Func's signature // do stuff with [b]b[/b] here }And when you call your first function: myFunction(42, new Func(delegateFunction));This is probably very confusing for you, but if you look up delegates in the MSDN, you'll find tons of information. :) Good luck.
  18. Well, you don't *have* to close the splash screen in the Form_Load event. You can take out the splash.Close() line and it will remain, so then you can close it however else you like. The only reason I would recommend my way is because it allows you to actually initialize the form (which is what splash screens are for), while many of the other ways don't even load the form until the splash screen closes, so no real initializing happens, defeating the point of a splash screen. It's all a matter of preference. :)
  19. Garbage collection only affects managed code, which your DLL is not. Is there a reason you need this DLL to be __cdecl and not __stdcall? If you say it works when you use __stdcall, why not just use that way? Or is it for some assignment or something?
  20. Use the WebClient class and its DownloadData method to retrieve HTML from a website.
  21. OK, I'm not sure if that's your whole code, but if it is, I don't know what you expect it to output. You are declaring the variables dbltxtTest1 etc and using them without ever giving them a value. However, if you want to use controls on the form (txtTest1, etc), you need to use Double.Parse() for that. After: Dim dbltxtTest1 As Double Dim dbltxtTest2 As Double Dim dbltxtTest3 As Double Dim dbltxtAverage As Double Dim txtLetterGrade As Stringput this: dbltxtTest1 = Double.Parse(txtTest1.Text) dbltxtTest2 = Double.Parse(txtTest2.Text) dbltxtTest3 = Double.Parse(txtTest3.Text)
  22. Here, I just made this: http://www.xtremedotnettalk.com/showthread.php?s=&postid=385716#post385716 I suggest you look at that, as I think it is the best way to create a splash screen.
  23. As simple as it may sound, this is among the more common questions asked, so I made up this example. This is one of a few ways to make a splash screen, but it's probably the most effective. This shows how to make a real splash screen, which is shown while the program is busy doing some initialization. In this particular instance, it fills a list box with 50,000 items (on my box it takes a few seconds -- if it's too slow on yours, just reduce the number). The concept is very easy: The whole process is really very simple. The very first thing the main form's load event should do is show the splash screen. After that, do all your initialization processing (i.e. the loop that adds the items). At the end of all the initialization, close the splash screen. The main form won't show until after the Load event completes, so it will work as intended. The advantage of this method over the others (i.e. setting the startup object to Sub Main and loading both forms separately) is that while the splash screen is open, initialization code can be run from within the form, allowing it to set up form variables and such. Note: It is my strong opinion that splash screens should never be used as anything other than something to look at while the program is initializing. If the program loads fast enough so that a splash screen is not needed, you should not cause one to appear, and especially not intentionally delay the program from starting just so that you get to see the splash screen. splashscreen.zip
  24. You have to add the three numbers and divide by three, not just add the three numbers.dbltxtAverage = (dbltxtTest1 + dbltxtTest2 + dbltxtTest3) / 3Also your variable txtLetterGrade is 1) not being declared as anything (you should use As String for textual variables), 2) not being used once you set it to the proper letter grade.
  25. But you're not doing it with ADO.NET... you're using from ADO. You referenced the ADO library from .NET, but that does not mean it is managed code. Anything in the ADODB library is legacy ADO, while anything in System.Data is ADO.NET. It *is* possible to fill DataSets (ADO.NET) with Recordsets (ADO), but even if you are doing this, there is no reason to in this case.
×
×
  • Create New...