Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You may want to look at one of the classes under System.Collections an ArrayList may be a easy option for you in this case as it provides nice easy Add, Remove etc methods.
  2. Easiest way is in the IDE bring up the property windows (F4 by default). You should see a button on the property window that looks like a yellow zigzag thing, click this and you will see the controls events - just double click the event in question. The reason adding them in code doesn't work is you also need to associate the event handler with the event. e.g. //given the following event handler private void button1_Click(object sender, System.EventArgs e) { } //the following code would need to be executed to associate them together this.button1.Click += new System.EventHandler(this.button1_Click); using the IDE will automatically do this for you though.
  3. I'd go with Environment.NewLine myself - works in all .Net languages.
  4. Have a look at this little change to your code.... Function CalcGrade() Dim x As Integer For x = 0 To I If Val(Grade(I)) = 0 Then Exit For 'does this fix it?
  5. Rough and ready but should give you the idea Dim files() As String files = System.IO.Directory.GetFiles("c:\") For Each file As String In files System.IO.File.Move(file, "d:\" & file.Substring(3, file.Length - 3)) Next
  6. Short for Platform Invoke, calling the OS API really.
  7. for i = 0 to 100 grades(i) = inputbox("Score?") next
  8. Problem is that the variable score will be a copy of each item in the array, changing this copy will not affect the value in the array itself.
  9. Did the array already contain any items? If so then this would have replaced them. If there are no items in the array then this will do nothing. Could you post the part of the code where you declare and initalise the array.
  10. Set the datasource to the dataset's table i.e. DataGrid1.DataSource = ds.tables(0)
  11. PlausiblyDamp

    Gc

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetgcbasics.asp http://msdn.microsoft.com/library/en-us/dndotnet/html/dotnetgcbasics.asp?frame=true
  12. SELECT Id ,manyfields from tablename where Id = (SELECT MAX(ID) from tablename) edit: typo
  13. Something like the following any use Dim md As New System.Security.Cryptography.MD5CryptoServiceProvider Dim input As String = "Test String" Dim result() As Byte = md.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(input))
  14. On solution explorer there is a button 'Show all files', click this and you should see the folder in the solution explorer but greyed out. From there though you shoul be able to right click on files in the folder and include them again.
  15. What are the build errors though? They should be listed in the tasks window. Also search your code for anywhere that says Form1 and change those entries to frmMain.
  16. Just a guess but when you installed VC++ did you install the runtime libraries - and both the ANSI / UNICODE versions. It could be trying to link to a version you didn't install.
  17. Debug builds are often much larger than release builds (no debug stuff plus code optimisation takes place). Also most C++ code will involve linking to various runtime libraries - will makea big difference if you link to the dll version or the static version.
  18. makefiles just automate a build process, they usually dictate the order files and projects get built.
  19. Private Sub Form1_KeyDown(ByVal sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.F5 messagebox.Show("F5 was pressed"); End Select End Sub
  20. Eliminating the symbols you suggest would radically alter the C and related languages, to the point where they wouldn't be C at all. Is { ... } really much harder to read then If ... End If or Class ... End Class? Once you get used to the symbols they are not difficult to understand and do result in more compact code, again once you understand the meaning then things like && are just as easy to read as VB's AndAlso operator. Ultimately this is one of the advantages of .Net - if you don't like C# don't use it - pick a language you like out of all the supported ones (MS or 3rd party).
  21. What kind of precision are you look at? How many places before and after the decimal point do you require? Would a decimal data type not suffice?
  22. Could you give a bit more detail? Do what with the numbers exactly? Also when you say math with strings - do you mean convert strings to numbers and then do math?
  23. Make sure you call picBox.Image.Dispose before deleting the file e.g. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load System.IO.File.Copy("c:\winnt\zapotec.bmp", "c:\temp\zapotec.bmp") PictureBox1.Image = Image.FromFile("c:\temp\zapotec.bmp") End Sub Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing PictureBox1.Image.Dispose() System.IO.File.Delete("c:\temp\zapotec.bmp") End Sub
  24. Interfaces by definition contain public functionality, they are designed to provide a consistant public interface to a series of components. Basically you can't put protected or private members into and interface. However if your controls are in a single classlibrary you could mark the interface as being internal (friend in vb) and in each of the classes mark their implementation as also being internal. This way the interface can be used within the DLL but not from outside the DLL.
  25. http://www.codeproject.com/vb/net/ProgressStatus.asp
×
×
  • Create New...