Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. The error is there becuase if you read the required argument type for the combination you showed you will see that it accepts a Font object that will be used as a base for the one you are creating. It doesn't accept a string. The try this and see if its what you want: New Font("Times New Roman", 12) '12 is the font's size
  2. If you look closer at the arguments the constructor accepts you will see that it takes much more of them if you want to build a new font without a base one.... [edit]You edited your post so Im not sure where you are with this problem now :)[/edit]
  3. That is a string not a Font object. Use this: New Font(<set the arguments here>)
  4. Simply create a new Font object and pass in the information you want into the constructor. Is that were you are encountering errors?
  5. First create a Bitmap object from the file, create graphics from the image and use the DrawString method of the graphics to draw the text. Then simply use the Save method of the Bitmap object. 'First load the image Dim b As New Bitmap("path") 'get the graphics object from the image so you can draw onto the image Dim gr As Graphics = Graphics.FromImage(b) 'draw text gr.DrawString("text", Me.Font, New SolidBrush(Color.Red), 10, 10) 'save the image b.Save("path") 'dispose gr.Dispose() b.Dispose()
  6. Im not sure if im understaind your problem the right way. You are searching a file for the name that the user gives you right? But you didn't say what you want to do with that name. Do you want to find it and parse it for the numbers or something? Sorry If I misunderstood this completely :). To make enter start the search, go to your form's properties and set its accept button property to the button that has the search code.
  7. (TextBoxName.Text)
  8. You mean earase from the listbox? Call the Clear method of the Items property to do that: YourListBox.Items.Clear() If you want to know how many items there are in the listbox (one way to check if there was no matches) then use the Count property of the ListBox's Items property. If YourListBox.Items.Count = 0 Then 'no matches
  9. To see if a file has a readonly attribute use the FileInfo class and its Attributes property: Dim f As New IO.FileInfo("path to the file") If (f.Attributes And IO.FileAttributes.ReadOnly) = IO.FileAttributes.ReadOnly Then MessageBox.Show("Read only.") End If
  10. True, I should have looked closely at the data. Here is how you can implement your own IComparer like Jaco mentioned: Imports System.Text.RegularExpressions Public Class StringComparer Implements IComparer 'implement the comparer so the Sort method will take it Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare 'get the first number from the x object that was passed using regular expressions so it very easy 'to find numbers that are more then 1 digit long Dim num1 As Integer = Convert.ToInt32(Regex.Match(x.ToString(), "[0-9]+").Value) 'get the first number for the y object Dim num2 As Integer = Convert.ToInt32(Regex.Match(y.ToString(), "[0-9]+").Value) 'if the number from x is bigger then return 1 (or any positive number) If num1 > num2 Then Return 1 'if they are equal return 0 ElseIf num1 = num2 Then Return 0 'if x is less then y return -1 (or any negative number) Else Return -1 End If End Function End Class Then you can pass in the comparer to the Sort method: Array.Sort(yourarray, new StringComparer)
  11. Use the shared method of the Array class to sort your array.
  12. Are you clearing the depth buffer when using device.Clear? That is the first step. The next step is in Device.Clear too, it is the third argument which specifies how much of the data from the depth buffer you want to show. You probably have it set at 0.0F which will show nothing. To show everything use 1.0F which is the max value.
  13. Syntax coloring is not hard to implement using Regular Expressions. You only have two keywords so it shuldn't be a problem. For your vetical lines, if you wish to use this character: | then searching for THEN and NewLine might do what you want, you can for example replace it with THEN, NewLine and |.
  14. One way to do voice communication would be via DirectX/DirectPlay.
  15. When creating a DLL project the Windows.Forms assembly is not imported by default, and that is where Application class is. You need to import the assembly.
  16. Use the Process class from System.Diagnotics namespace. It has a Start method which will start up the program for you. Dim p As Process = Process.Start("exe filename")
  17. Set the attributes to normal only like you showed in the previous post. Normal can only be used byitself so you are not really changing anything and the file is still readonly.
  18. Are you by any chance trying to write to a file called "file path" which I used as a place holder for a file name? :)
  19. What you have works fine for me. What error does it show you when you say it won't let you write to the file again?
  20. To set the file to readonly you don't need that. The FileInfo class will provide you with Attributes property, which you can use to set file attributes. Dim fi As New IO.FileInfo("file path") fi.Attributes = fi.Attributes Or IO.FileAttributes.ReadOnly
  21. One thing, why not directly inherit the panel? If the only reason you are doing it like that to have a grey border like that then don't do it. You can easily draw your own border using GDI+ in the control's paint event.
  22. You could use the ControlAdded event of your container and add the control to the panel and remove it from your container.
  23. If I understood your question correctly then inheriting your control from ContainerControl rather then Control will allow the design time drag-and-drop of controls onto your control since then your cotnrol will be a container.
  24. I would call that the worst method you can use because DirectX provides functionality to take screenshots. What didn't work for you while using D3D to take the screenshot?
  25. FolderBrowserDialog class will provide with that functionality. If you are using .NET 1.0 which doesnt have that class, here is a workaround: http://www.elitevb.com/content/01,0077,01/
×
×
  • Create New...