Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. Well, I suppose it's possible that your buffer is a bit too large. Try doing it like this: Dim lSize As Long Dim sString As String = New String(" ", 300) 'create the buffer; this is a better way than String$ lSize = GetPrivateProfileString("irsconnection", "irsconn", "", sString, 300, sFile) sString = sString.SubString(0, lSize)That dynamically gets the required size, rather than fixing it in one spot. Also, you should not use String$, as it is a VB6 compatability function and is not CLR compliant.
  2. That depends.. how are you reading from your INI file? Post code please.
  3. Robby: what is the error that Option Strict gives you?
  4. Well, I am very strict about my personal coding standards, and in my opinion, that is one that should be followed. There's nothing wrong with using those functions, but I don't. They might do the same things when compiled, I don't know.
  5. Would arr(iRow, iCol) = Convert.ToString(CData(iRow, iCol).Value)not work? I avoid any functions that you can't use in both C# and VB.NET (CWhatever() functions, MsgBox(), Int(), etc).
  6. You'll have to be much more specific in what you're asking.. I can't make heads or tails of your question! What is it you're trying to do, and what is the problem you are having?
  7. Also, Dates have built in < and > operators;If dateA < dateB Then 'dateA comes before dateB End If
  8. This would require an extra field in the posts table (or a complex query to find out which post number it is based on the post date), both of which would require extra load on the database. Not to mention it would require a huge reindexing of the posts in the database so to update the post counters. Not really worth it. :-\
  9. MessageBox.Show([Enum].Parse(GetType(Animals), "Dog"))If the Enum was defined Private Enum Animals Bird = 1 Cow = 2 Dog = 3 End EnumIt would return 3.
  10. It's probably more trouble than it's worth. Making your own button control that supports gradients would be much simpler, most likely.
  11. You can add custom classes to a listbox that can have as many properties as you want. The return value of the ToString method will be what is shown. For example, Public Class MyListItem Private _dataValue As Object, _text As String Public Sub New(text As String) _text = text End Sub Public Property Text As String Get Return _text End Get Set(ByVal value As String) _text = value End Set End Property Public Property DataValue As Object Get Return _dataValue End Get Set(ByVal value As Object) _dataValue = value End Set End Property Public Function ToString() As String Return _text End Function End ClassAt this point, you can add one of these to a listbox and the _text property will be displayed. Dim item As New MyListItem("Life, The Universe, and Everything") item.DataValue = 42 lstListbox.Items.Add(item) MessageBox.Show(lstListbox.Items(0).DataValue)) 'shows 42
  12. Try here.
  13. Believe it. :) If you have a very good understanding of Windows Forms and the .NET framework, a form designer is not hard. divil, resident moderator here, has created his own version of the IDE with a windows forms designer much like the one built into VS.NET. The only part provided with the framework is the property grid, which is provided with VS.NET. Just look in the components menu.
  14. That is when you need to declare a new instance of the form to use it. See my post above.
  15. That's true, except for the somewhat lacking support for it that many hosts have. I'd say php is probably the most popular as of right now.
  16. That function is not shared within the form. You'll probably need to do something like this: Dim myForm As New frmStartup myForm.exposeAvailableCom()It probably should work, even though the function is private, because you are accessing it from within the form.
  17. Click a control, and then click the lightning bolt icon in the property grid. Viola! A list of events. Double click on one, or type in the desired sub name and press enter.
  18. All I did was create a new project, put a PictureBox on it and paste in your code. Nothing more. I don't see the point in sending out the project.
  19. Did you declare and set a public variable in your CodeBehind?
  20. That is very odd. When I run your code, and I move a MessageBox over top of it, it simply causes it to reupdate itself; it just calls the Paint event again.
  21. Do you mean you're doing your drawing in PictureBox_Paint() event? If that is what you mean, then it should work. Otherwise, that is where you should do all your drawing. Post your code, please. :) [edit]Also, don't use Invalidate inside the Paint() event, because that will cause it to CALL the Paint event; this can cause stack overflow, I think.[/edit]
  22. Are your TabIndex set up correctly? The tabs only follow the order that the controls' TabIndexes are set to. If the third control has the TabIndex of '2' and the first control of '1', then the order of tab will be first control -> third control. You need to change it manually. Click 'View -> Tab Order...' to go into TabIndex setting mode, where you can click the controls in the order that you want them.
  23. You might be trying to send using the GET method, when it wants the POST method. You should try using a NameValueCollection to store your parameters and then passing that to the UploadData method, along with the "POST" method.
  24. I think it is pretty much the same, yes.
  25. In the CodeBehind: Public Class MyWebForm Inherits System.Web.UI.Page Public a As String Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load a = "test" End Sub End Class In the asp.net page: <body> <% Response.Write(a) %> </body>
×
×
  • Create New...