Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. Create the graphics object using the Graphics.FromImage method and pass in the Image property of the Picturebox.
  2. Lua is a poplular scripting language for games. http://www.lua.org/
  3. If you are looking for the name of a control then you don't reflection. Simply going through all the controls in your usercontrol and checking the name will do the job: For Each ctrl As Control In UserControl11.Controls If ctrl.Name = "btnXY" Then 'there is a control with that name End If Next
  4. What part of it you don't get? There is a lot of overloads for it so I don't know what you need help with. A simple one: 'Create a new instance of the Form class Dim fr As Form = Activator.CreateInstance(GetType(Form))
  5. .NET Class Library does not contain a masked textbox. But if you do a search on google for something like ".net maksed textbox" it will come up with few good results regarding some custom made controls.
  6. Just like VolteFace, I don't see a point in 3D windows other than eye candy.
  7. That is a very interesting project :). But the person doesn't speak very highly about .NET in his text :).
  8. Look into thoses two classes: System.IO.StreamReader and System.IO.StreamWriter.
  9. I see no reason for not be able to making open source apps with .NET. There is plenty of those on the internet.
  10. Both examples do a different thing. In the first you are setting another ArrayList into your variable. In the second one you are adding an ArrayList to your current ArrayList. What excatly do you want to do?
  11. Use the GetThumbnailImage method of the Bitmap object to return a scaled image.
  12. Not possible with the MessageBox. You can only choose from a set of predefined buttons. Create your own form and cutomize it as you want and use that in place of a MessageBox class.
  13. The GetFileName method of the IO.Path class will do what you want. It is way more elegant then trying to extract it yourself. Dim filename As String = System.IO.Path.GetFileName("path")
  14. What does not work? What line? Does it throw an error or simply doesn't do what you want it to do?
  15. That happen because you are drawing the white rectangle over your image. You are creating a bitmpa object from the image file and then drawing on it. Instead, create a new Bitmap object but not from a file but rather 700x500 size like you want, then create Graphics object from that. Now use the DrawImage method of the Graphics object to draw another Bitmap object you declared which contains your image. Dim back As New Bitmap(700,500) 'create bitmap with the size you want Dim gr As Graphics = Graphics.FromImage(back) 'get graphics for it Dim img As New Bitmap("file path") 'load your image gr.FillRectangle(New SolidBrush(Color.White), New Rectangle(0,0,700,500)) 'fill the background gr.DrawImage(img, xpos, ypos) 'draw the image at specified position 'draw whatever else you need .... back.Save("file path") 'save it img.Dispose() 'dont forget to dispose! back.Dispose()
  16. Post your tutorials/code in Random Thoughts forum, and it might be moved to the Tutor's center or the Code Library by a moderator or an administrator if its useful.
  17. You can use FolderBrowserDialog class from the Windows.Forms namespace. That dialog lets you select directories.
  18. Add this code where (its a good place for that) you import your namespaces, include headers etc. #using <dllname> PS. This is if you are using Managed C++.
  19. To open the file in append mode create a new StreamWriter object, and as a second argument pass in true which will tell the stream writer that you want to write to the end of the file.
  20. You mean alphabetize its contents? Its lines? If lines then, read all lines of the file into a string array and then pass in the array into the shared Sort method of the Array object which will sort it for you.
  21. Open the file with a StreamReader. Loop through the file using its ReadLine method which reads on line. Add 1 to the your counter. Continue the loop while the Peek method of the stream method does not return -1.
  22. Did you consider deleting the file and then recreating it? But if you still wanna do it like that here is how you can. Open the file using StreamWriter and specify the append argument as false which will clear the file. Dim wr As New IO.StreamWriter("file path", False) 'dont forget to close the stream wr.Close()
  23. Use the FileName property of the dialog. TextBoxName.Text = ofDialog.FileName
  24. Would you mind explaining your problem a little bit more?
  25. You are declaring an array of Graphics objects. Another thing is that you need to set the Graphics object to the image. Declare it like this: Dim g As Graphics = Graphics.FromImage(b)
×
×
  • Create New...