Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. This goes in the paint event of your picturebox you want to draw onto, not in the click event. I corrected the typo in the code so it should work now.
  2. Yes, maybe that would help as I dont think I ever seen this error. :)
  3. Sorry, I mistyped my last sentence in my previous post :) (edited now). If you want the user to be able to draw multiple boxes then this how I would suggest doing it. Create an array list which will store Rectangle objects, then everytime a rectangle is drawn add its coordinates and size in a form of Rectangle object to the list of rectangles. Then in the Paint event of the picture box simply go through every rectangle in the array list and draw it, like this: Dim rect As Rectangle For each rect in RectList 'RectList in this example is the array list holding all rectangles e.Graphics.FillRectangle(ColorYouWant, rect) 'get the rect and draw it Next
  4. The best way would be to draw in the paint event, then you can use GDI+ to draw the square using FillRectangle with a color set to yellow with alpha blending. For example: (in paint event) e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(100, 0, 255, 255)), 100, 100, 100, 100) 'draw a rectangle using solid brush with alphablending Also, do you want the user to be able to draw more than one rectangle?
  5. What library?
  6. Most people say that Microsoft made JScript just becuase they wanted their own scripting language, not JavaScript which was first developed by Netscape :). JScript is fully compliant with the scripting standards except minor exceptions for backward compatibility. So there is not much difference between the two, except some incombaptibilities with non-MS browsers.
  7. You can set the MaximumSize and MinimumSize properties to keep the form at one size. :)
  8. I dont know if I understood your correctly but you will always be able to access the control from code, even if its disposed because the variable held the instance of the control is still there.
  9. He means createing a class which has a shared collection of forms that you add the forms to: Public class Forms Public Shared AllForms As New ArrayList() End Class Something like this. Then from wherever you create an instance of your new form you would do this: Dim form1 as New Form1 Forms.AllForms.Add(form1) 'access the shared array list and add the form to it
  10. :) Yeah, they are used very commonly. For example open WordPad, you see the buttons down below the menu? That is a toolbar, same goes for VS.NET, except they have a custom toolbar that looks so much better than the standard one :).
  11. There is a toolbar windows forms control. Are you maybe thinking about some other toolbar? :)
  12. I also had a look at Wingdi.h, it seems to define more styles: /* Pen Styles */ #define PS_SOLID 0 #define PS_DASH 1 /* ------- */ #define PS_DOT 2 /* ....... */ #define PS_DASHDOT 3 /* _._._._ */ #define PS_DASHDOTDOT 4 /* _.._.._ */ #define PS_NULL 5 #define PS_INSIDEFRAME 6 #define PS_USERSTYLE 7 #define PS_ALTERNATE 8 #define PS_STYLE_MASK 0x0000000F #define PS_ENDCAP_ROUND 0x00000000 #define PS_ENDCAP_SQUARE 0x00000100 #define PS_ENDCAP_FLAT 0x00000200 #define PS_ENDCAP_MASK 0x00000F00 #define PS_JOIN_ROUND 0x00000000 #define PS_JOIN_BEVEL 0x00001000 #define PS_JOIN_MITER 0x00002000 #define PS_JOIN_MASK 0x0000F000 #define PS_COSMETIC 0x00000000 #define PS_GEOMETRIC 0x00010000 #define PS_TYPE_MASK 0x000F0000
  13. Oh, you were looking for the values :). Yes, I checked them in the VC++ compiler, they are 0-6 in the order they are shown on that page.
  14. Flush causes the buffers of the stream to clear and writes them to the file, this ensures everything you wanted to write to the file is actually written. Close does that and also begins the the disposing for the stream.
  15. There is a list here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pens_9wha.asp
  16. Yes, you can use it without MSSQL server. Its a stand alone, scaled down version of MSSQL Server.
  17. I think Windows Authentication is better for testing, it saves you some time entering the username and password :). Im not really sure about MSDE but MSSQL server creates an account named "sa" for a dafault account, so you might want to try that.
  18. Activated event would fire after the form is loaded and shown but it will also fire every time your reactivate your form, for example use another application and then get back to your form.
  19. It comes with the framework, when you install it it should be in the Framework's folder. So if the user downloaded the framework he/she should have it.
  20. You dont really need a database for that. To write to a file you need to use the IO.StreamWriter class. Declare a new instance of it and pass in the path at which the file will be saved: Dim writer As New IO.StreamWriter("path to the file") The you have to write the info to the file: writer.Write(username & ":" & location & ":" & userid) writer.Flush() 'make sure everything was written writer.Close() 'close the stream substitute the names of the variables with the ones you actually use. :)
  21. You also need to change the second argument from KeyEventArgs to KeyPressEventArgs. And also, KeyPressEventArgs only comes with KeyChar property so you need to convert it to an integer to detect enter being pressed: Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Convert.ToInt32(e.KeyChar) = 13 Then '13 represents ENTER e.Handled = True End If End Sub
  22. Do this: ListBox1.Items.Remove(ListBox1.SelectedItem) SelectedItem returns the currently selected item. This will delete it. You can also delete the current item using SelectedIndex and RemoveAt: ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) :)
  23. First, what kind of database you want to use? For this i would assume Access? :)
  24. If you dont want to create a web service then go with the file approach. Try...Catch is an error handling structure. You set it up like this: Try 'code that can cause errors here Catch ex As WebException 'or any other exception you might want 'handle the error or simple do nothing End Try
  25. That would the easiest way, set up a Try...Catch block around the line that download the file and catch the WebException exception. Or, use InternetGetConnectedState API.
×
×
  • Create New...