Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. Very nice application, could be a great start for a fully functional 3d modeller. Good job. :)
  2. You are looking in the wrong place for Direct3D matrices, not System.Drawing.Drawing2D but Microsoft.DirectX. :)
  3. You can specify the format for a date object using its ToString method: MessageBox.Show(DateTime.Now.ToString("hh:mm:ss:fffffff")) This example will show you the current time plus fraction of a second with seven digit precision. Dont use the TimeOfDay property because its a leftover from VB6, and those shouldnt be used.
  4. You would have to store the dates the holidays fall on yourself.
  5. Here is an example: Dim dstart As DateTime = DateTime.Now 'set start as now Dim dnext As DateTime = DateTime.Now.Add(New TimeSpan(1, 0, 0, 0)) 'set next date as now plus 1 day MessageBox.Show(dstart.Add(New TimeSpan(dnext.Ticks)).ToString) 'show the date that resulted in adding the start date plus the next date 'using the TimeSpan object and Ticks property of the next date :)
  6. Are you talking about limiting your frame rate so its the same on all computers if the computer can run at that speed? If yes then check out this thread: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=75420
  7. If you are trying to hide the first form from the Load event then it will be shown again because the form is displayed after the Load.
  8. You have to change the name of the files yourself, if you dont want to do that just add a new Windows Form and call it whatever you want and the file will be called that too.
  9. There error says that there is no instance, do you currently have an instance of the object that causes the error, the the sound playing when you call that code? Also you say you want to stop the sound, Stop() method would work.
  10. If you are using Framework 1.1 then there is a class named FolderBrowserDialog in the System.Windows.Forms namespace which will do just that.
  11. You are creating a new label and not adding it to the form's control collection. The image shouldnt be a problem but the label itself is not visible.
  12. You could also setup a class with shared members so you wouldnt have to use the Owner property and you would not have a problem accessing the form instances from anywhere in the program.
  13. Moving the whole application would be better then single components. You can create a wrapper for .NET class and use it, but framework will still be required. Go to your projects properties, then from the left choose Configuration Properties, then build. Then check, Register For COM Interop.
  14. It would be better if you did it without error handling once so you could show us where it throws the error.
  15. I would recommend looking into XML Serialization for doing things like that. XML Serialization the object or objects you want to write to a file a lays them out in an XML file. If you search Google for XML Serialization you should find a lot of examples and tutorials. And then use Deserialization to read back the file. :)
  16. This page has some useful info, and some short tutorials: http://samples.gotdotnet.com/quickstart/howto/default.aspx?url=/quickstart/howto/doc/adoplus/adoplusoverview.aspx
  17. Here is an example file, I dont know what VS.NET version you are using so I didnt attach the project. Create a new windows application project and then just add this file to it and run it.regex.vb
  18. In the case of the code you showed eariler you would do this: matchcoll = reg.Matches(TextBox1.Text) Sorry I wasnt clear, you have pass in a String type to the Matches().
  19. From a description it seems like a very basic book. My guess would be that they dont really concentrate on making something complex but very simple things.
  20. Im sorry, it should it be like this: matchcoll = reg.Matches(variablewithtext) Just put the name of the variable you have the text in when caling Matches. Sorry, I forgot to type that little piece of code :)
  21. You dont have to add a reference to the Text namespace, dont have to do it for RegularExpressions one either because they are included in the same physical file as System reference which should be already referenced. Where are you putting the Imports statement? What is the error?
  22. It will raise an error if a property is not accessible to a Control class, at least it raises one for me :)
  23. If you are using the Setup project from VS.NET then you cant customize it like that. As far as I know the only things you can change is the text on the dialog windows and images on some others.
  24. That will work because all controls have the Name property, but if you will ever want to search by a property that is not accessile to all controls you will have to do it a slightly different: Dim ctrl As Control For Each ctrl In Me.Controls If TypeOf ctrl Is TextBox Then DirectCast(ctrl, TextBox).SelectionStart = 1 End If Next This is just an example, if you didnt do this your would get an error about a cast being not valid if a control that was being checked didnt have this property. You have to check what type the control is, and then if you get what you want, cast the control variable used to iterate to the wanted type. :)
  25. This should work: Imports System.Text.RegularExpressions Now create a new RegularExpression object with the following pattern: Dim reg As New Regex("[0-9]+") This pattern will match any integer number, like: 1234, or 123. Now to get all the matches from that pattern, do this: Dim matchcoll As MatchCollection 'all the matches regex finds in the string matchcoll = reg.Matches("text to check") 'this returns all matches from the regex Now you can go through all of the matches like this: Dim m As Match For each m in matchcoll MessageBox.Show(m.Value) next This example will show you all the matches in a MessageBox. :)
×
×
  • Create New...