Jump to content
Xtreme .Net Talk

Bucky

*Experts*
  • Posts

    803
  • Joined

  • Last visited

Everything posted by Bucky

  1. Could we see the method that contains the line of code that causes this error?
  2. Well if the "hotspots" you're looking for are controls, then you can use the control's MouseEnter, MouseMove, and MouseExit events to handle the spots. Or you could place PictureBoxes or some other control around the form and use their mouse events as the hotspot handlers. Or, in the form's MouseMove event, you could compare the mouse's position to a collection of Rectangles (created on the form's load) and see if the mouse is inside the Rectangle by using its Contains() method. Just some ideas.
  3. Instead of using Labels in the first place, you could draw the text on Form manually in its Paint event. You'd have much more control over painting them, and then you could paint the red text without the ugly label background.
  4. Actually, the Form.Closing event is the same event as the QueryUnload event in VB6; it fires before the form actually unloads, so you can cancel the unloading of the form if need be. The equivalent of the VB6 Unload event in VB.NET is Form.Closed
  5. "Can this project be done using VB.net? What about ASP.net? Is that the correct choice?" ASP.NET is not actually programming language, per se, but it instead can be programmed in any .NET language (C#, VB.NET, J#, etc.), so don't get it confused as a completely different language. And yes, this can easily be accomplished through it. "Is learning HTML necessary?" If you're using the standard ASP.NET server controls and creating all the pages in the Web Forms editor, then no, you don't need to know HTML. A basic understanding of it would be helpful, though, in case you need to go "behind the scenes". "What books do you recommend?" Any "Teach Yourself ASP.NET In 21 Days" or in "24 Hours" or something should be sufficient, assuming that you have an understanding of the syntax of the language you're going to program in. Good luck.
  6. I'm not sure about the font, because you would have to install it to even be able to use it, but Color.ToArgb() returns an integer that's unique to that color. You can then get the number back into a color structure by calling Color.FromArgb().
  7. Accomplished via: Me.BackGroundImage = Image.FromStream([Assembly].GetExecutingAssembly().GetManifestResourceStream("image filename goes here"))
  8. I've been working a little on a simple ice cream stand simulation game... thing... Ice Cream Tycoon or whatever. :)
  9. You also need to upload the compiled DLL files in the appropriate directory (probably /bin). You do not need to upload the .aspx.cs files, because the code is compiled and run in the DLL.
  10. What site are you trying to access, leontager?
  11. Bucky

    Cookies

    If you don't need an instance of a class to use the method, you can call it as a shared (static in C#) method of a class. Add a new class to your project, and add the method as Public Shared (public static in C#), then you can call it anywhere in your project by using ClassName.MethodName().
  12. The property I mentioned does that exactly.
  13. It makes more sense, programmatically, to loop through each row and then update the value of each column before continuing to the next row. That way you could skip specific columns or delete them if needed. Plus, it would only require one loop. Since you're doing the same changes, just in a different order, there should not be a noticeable difference in speed.
  14. Just use Substring to set the text to one less character: TextBox1.Text = TextBox1.Text.Substring(0, TextBox1.Text.Length - 1)
  15. The application resides, by default, in c:\inetpub\wwwroot\appname\, although this could be different. To get the local application path, you can use the PhysicalApplicationPath property of the HttpRequest class (accessible from any ASPX page by Request.PhysicalApplicationPath)
  16. Sure, just create a DataSet and add different tables to it, and save the DataSet. Dim ds As New DataSet() Dim table1 As New DataTable() Dim table2 As New DataTable() ' Here you add the columns and rows and stuff ds.Tables.Add(table1) ds.Tables.Add(table2) Then just save ds using the WriteXml() method.
  17. How about a select case statement? Loop through each item in the text file and show the appropriate forms. ' Add a beginning loop here Dim frm As Form Select Case formName ' formName = the form to show's name Case "forma" frm = New forma() Case "form123" frm = New form123() ' etc. End Select If Not frm Is Nothing Then frm.Show() ' Close the loop here
  18. I scoop ice cream.
  19. Control arrays are not supported in VB.NET in the way that you're used to them in VB6. You will need to create your own collection (probably an ArrayList), and add each checkbox to it, and then you can loop through that. You'll have to cast the checkboxes in the list by using DirectCast, unless you want to create your own strongly-typed version. ' In general declarations: Dim r As New ArrayList() ' In the form's Load event: With r .Add(r1) .Add(r2) .Add(r3) End With ' Then you can loop through the ArrayList r Dim i As Integer For i = 2 To 3 DirectCast(r(i), CheckBox).Location = New Point(r1.Location.X, DirectCast(r(i+1), CheckBox).Height + 30) Next
  20. You could make your own form with a TextBox and an OK and a Cancel button, and overload the ShowDialog method so that it accepts the question and returns a string of what the user entered. You then have complete control over the dialog and how it displays. For example, in a dialog with a TextBox, Label, and two command buttons (with their DialogResult properties set to OK and to Cancel): Public Overloads Sub ShowDialog(query As String) As String Dim result As DialogResult Label1.Text = query ' Set the query so it shows up on the label result = Me.ShowDialog() ' Show the dialog If result = DialogResult.OK Then ' the user clicked OK Return TextBox1.Text ' return the textbox's value Else ' otherwise... Return Nothing ' Return Nothing (duh) End If End Sub Then, from another form: Dim inputFrm As New InputForm() ' InputForm = whatever your named the dialog Dim boyName As String = inputFrm.ShowDialog("What's your name little boy?") MessageBox.Show("Why hello, " & boyName) Or something. :p
  21. You need to change "TabControl" to the actual name of your control.
  22. The TabControl has the same event as the ListBox, that is, SelectedIndexChanged. Add code in here that, if the selected index is 1 (the second tab), loop with a call to DoEvents in the loop until the SelectedIndex changes to something else.
  23. I know Volte is probably going to beat me to this, as he types about ten thousand WPM, but what you're trying to do is very simple. The ListBox control is already scrollable when the items in it are longer than the listbox. To make it "linkable", all you need to do is add code in the SelectedIndexChanged event. Add a Select Case statement inside the event handler to check the value of the SelectedIndex property to see which item was clicked, and act appropriately. [edit]Waaaaaaaaay too slow, even for the response. Gah.[/edit]
  24. What do you mean, "create"? Do you want to make your own custom control from scratch, or do you just want to stick a ListBox control on your form? And what do you mean by "linkabble"? Linkable to what?
  25. Don't set the Owner to a form. Assuming that Owner can be any class that inherits from Control, create a PictureBox in the corner of your form and set the Owner property to that.
×
×
  • Create New...