Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. If you are setting the Text properly directly, that is why. If you want existing text to retain its formatting, you will need to use the SelectedText property to append text.With RichTextBox1 .SelectionStart = .Text.Length .SelectedText = "Some Text to Append" 'format the stuff here End With
  2. Because of the way managed code works, you don't need to set clsNew = Nothing before creating a new one. You can call clsNew.Dispose() (if your class implements IDisposable) to dispose of the object, but the class will be disposed of as soon as there is no reference to it anyway. You can simply use clsNew = New MyClass to set a new instance, and the framework will handle the disposition itself.
  3. Can we see the exact code you're using?
  4. Since you can have overloads in .NET, it's best to have multiple overloads. For example, declare the API multiple times, using different types for the last parameter.
  5. You can still create arrays of controls through code if you absolutely need to. You just can't display them in the designer. Search the forum, there are tons of threads about this.
  6. I'm fairly sure Dispose() doesn't allow the Closed or Closing events to be called, so it's best to use Close over Dispose.
  7. I got this PM from hazejean, and for the benefit of others who may have the same problem, I will answer here: To add a hander to an event dynamically, use the AddHandler function. First create a handler sub with the proper parameters (you can generally get this from the MSDN, or by copying and pasting the params from an existing button). For examplePrivate Sub ButtonClickHandler(sender As Object, e As EventArgs) MessageBox.Show("Click!") End Sub 'to hook up the above hander: AddHandler Button1.Click, AddressOf ButtonClickHanderAs usual, consult the MSDN for more information about handling events.
  8. Voila! :)
  9. Send either "~" or "{ENTER}".
  10. Watermark would be putting some sort of logo or text mark on top of the picture which, while not disrupting the look of the picture, makes it rather useless to others because it has your name on it.
  11. OracleClient is part of ADO.NET. I wasn't thinking when I posted the thing about ODBC drivers - ADO.NET uses "Data Providers" (that's the SqlClient and whatnot) to interface with the databases. They are sort of like ODBC drivers, only written for ADO.NET. .NET 1.1 ships with an Oracle data provider, and that's what OracleClient uses. Here's some light reading for you: http://www.fawcette.com/vsm/2003_01/magazine/features/beauchemin/default.asp
  12. Is there any code in the Load or Resize event that is setting the size of your form to use twips (roughly 1/15th of a pixel on most displays) from VB6? Since Twips no longer exist in VB.NET, using them would cause your form to be much larger than normal.
  13. .NET has a bunch of built in cryptography functions that may be of use to you. Look at the System.Security.Cryptography namespace.
  14. ADO (ADO.NET in this case) is not a kind of database, but rather a group of objects that allow you to connect to a database (any kind of database, as long as there is an ODBC driver available for it). However, the OracleClient supported by the .NET framework (version 1.1 only) is indeed part of the ADO.NET library, just as much as the SqlClient or Oledb functionality is. Although I'm not familiar at all with Oracle, I imagine that the ODBC driver is making a native connection to the Oracle data source. The OracleClient objects are simply wrappers to this connection.
  15. Not sure what you mean by "control code that is supposed to be generated." The only control code which is generated is created when you draw a control on the form with the designer. Your code is not altered when you dynamically add a control. However, Button1.Show() should cause the button to appear. [edit]D'oh, I got sidetracked by another post and didn't push Submit[/edit]
  16. Multi-thread controls which are part of the Form's Control collection aren't possible. If you created a control within one thread and tried to make it a child of a control in another thread (i.e. the main form) it won't work. The messages sent to the form and the control could be recieved in the wrong order if there were two threads at work. The GlowButtons project, simply modifies the properties of a button (which is not multithreaded) inside a secondary thread.
  17. I suggest you read here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconraisingeventshandledbycomsink.asp
  18. The Array() function in VB6 was rather ugly because it returned a variant array. There's an equally easy way in .NET which is not ugly at all:Dim stringArray As String() = {"Item 1", "Item 2", "Item 3"}Equiv in VB6 to Dim stringArray() As String stringArray = Array("Item 1", "Item 2", "Item 3")
  19. Normally I would never give advice such as this, but I have to recommend against putting any amount of work into this at all. It will not do you any good at all, and certainly it won't protect anything. Even good screen capture programs can probably capture the video from RealVideo. If it is displayed on the screen, it's possible to capture quite easily. I wouldn't worry about it. If you don't want people to be able to use your images so badly, you should consider other forms of protection, such as watermarking.
  20. Not very easily, I don't think. You might be able to do it with Reflection, but it shouldn't be necessary. You can just use the Object datatype to hold whatever value you need.
  21. Volte

    Errors

    You should also reference System.dll.
  22. Volte

    Errors

    You need to use the /reference:System.Windows.Forms.dll,otherfiles.dll commandline when compiling, if you're not already. Make sure you reference the proper DLLs.
  23. As has been said before, look at the MSDN. There is information on every single class in the .NET framework.
  24. Here's an alternative way using WebClient: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim wc As New WebClient() Dim b As Byte() wc.Headers.Add("User-Agent", "My Browser") b = wc.DownloadData("http://www.test.com/") TextBox1.Text = System.Text.ASCIIEncoding.ASCII.GetString(b) End Sub
  25. Ah, OK. Here's a quick example I whipped up. It should do the trick. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim hr As HttpWebRequest = hr.Create("http://www.test.com/") Dim wr As HttpWebResponse Dim sr As IO.StreamReader hr.UserAgent = "Browser Name" wr = hr.GetResponse() sr = New IO.StreamReader(wr.GetResponseStream()) TextBox1.Text = sr.ReadToEnd End SubHttpRequest is only for ASP.NET (which is why I assumed you were using it), so you need HttpWebRequest.
×
×
  • Create New...