Jump to content
Xtreme .Net Talk

mutant

*Experts*
  • Posts

    1922
  • Joined

  • Last visited

Everything posted by mutant

  1. mutant

    Font

    You could install the font during installation of your program.
  2. You need to have a reference to the instance of the Form1 you want to manipulate. What you are doing is declaring a new form1, you are not referring to the instance you are showing. Although that is not excatly what you are looking for take a look into this thread: http://www.xtremedotnettalk.com/showthread.php?s=&threadid=83092
  3. To make an Access DB use Access... To write text on two lines use the WriteLine method instead of Write.
  4. VS.NET does have a drag-and-drop web page design :).
  5. There are no two namespaces with the name System. The classes and such from both assemblies were simply included in the System namespace. For example you could create a DLL that would have all its classes in the Windows.Forms namespace. To use shared methods, properties etc. of the class you don't need to use the New keyword.
  6. mutant

    Exec

    You could also use the stream redirection provided by the process class. Dim pi As New ProcessStartInfo("file name") pi.RedirectStandardInput = True 'redirect the input to a stream you can write to pi.UseShellExecute = False 'required statement to use stream redirection Dim pr As Process = ProcessStart(pi) 'start the process using the process start info we created earlier dim sw As Io.StreamWriter = pr.StandardInput You can write to the stream now and the console window will receive the input (the input will not be shown on the console window).
  7. The System.Diagnostics.Process class and its Start method accept an exe path and arguments that you pass in to it. You can start your application like that and the arguments will be passed in.
  8. http://www.xtremedotnettalk.com/showthread.php?s=&threadid=83092
  9. The GetFiles method accepts a search pattern as second argument. You will probably have to do a call to GetFiles for each file type. Example pattern: "*.bmp" You can do something like this to include for the file attribute problem: 'include archive but not hidden Dim attrs As IO.FileAttributes = IO.FileAttributes.Archive And Not IO.FileAttributes.Hidden If filename.Attributes = attrs Then 'add file
  10. Same key cannot be added to a HashTable more than once. Btw. don't make converting this to a hashtable a big priority in your program. NameValueCollection accepts strings. Integers are easily converted from/to strings so that will work too. But NameValueCollection wont work for other objects which you can't really convert to string and have a good result from it. I suggested this from a habit of using collections that fit the right object. I probably misunderstood your design too, so I might be totally off here.
  11. You probably forgot to import the System.Collections namespace in which both ArrayList and HashTable reside.
  12. Im not really sure if im following the code you gave me as I have no idea what its suppoded to do, but from what I see HashTable will work. HashTable is a Key/Object collection too. [edit]You just edited your post, Ill reread it :)[/edit] [edit]Ah I see now. So basically you are setting a number as key and the count as the value. HashTable is perfect for that kind of job.[/edit]
  13. Convert the integer to a string using its ToString() method or the Convert class and its ToString method. You might want to look at a HashTable rather than nameValueCollection for anything else than strings.
  14. Are you sure? It works for me. And I forgot to add one thing, all files are created with the Archive atrribute so you have to add the Archive value to get the proper files.
  15. You can check attributes using the Attributes property provided by the FileInfo class. The enumaration has a System and Hidden members, just what you are looking for: Dim filename As New IO.FileInfo(strfile) 'if file is not system then add, do same for hidden but select the Hidden enum memmber rather than system If Not filename.Attributes = IO.FileAttributes.System Then ListBox1.Items.Add(filename.Name) End If
  16. Yes, you can add however many controls you want. (of course until you reach memeory limits and such :))
  17. You can't reference standard DLLs like that. You have to import the functions like stated above or using the DllImport attribute.
  18. Yes it is. For x as integer = 0 to lixbox1.Items.Count - 1 dim txt as new TextBox 'create a textbox txt.Location = new Point(x,x) 'set some other desired properties me.Controls.Add(txt) 'add the textbox to the control collection of the form Next
  19. You can get the width of text using the MeasureString method of a graphics object which will then return the size based on the string and the font you used: Dim gr As Graphics = Me.CreateGraphics() Dim wth As Single = gr.MeasureString("Some text is there", Me.Font).Width
  20. mutant

    C++ or C#

    First of all, Managed DirectX is not as slow as so many people think. It only has about 3-5% loss in performance according to the main Managed DirectX designer Tom Miller (and believe me, he knows what he is talking about!). This loss can be made up with development time descrease and in my opinion better design of DirectX for .NET. Why better design? If you have some kind of an IDE (doesn't matter what, could be Standard Edition of VS) for example you don't have to remeber hundereds of constants like using the SetRenderState method in C++ compared to RenderState in Managed DirectX which is a nice collection of properties. Your application will also be easier to debug, for example creating your own vertex formats that will fit Direct3D or having a list of clearly named structures. Ultimately your choice will probably be affected which language you like more. For example an experienced C++ DirectX programmer has no reason to move to C#/managed DirectX.
  21. If you have the Java SDK you can start coding away. But getting some IDE would do you good probably: http://www.netbeans.org http://www.jcreator.com
  22. You would have to convert the selected item from the listbox to a string and then get that process into your variable using the GetProcessesByName shared method of the process class. The method returns an array so the first member of the array should be good to use. Dim proc As Process = Process.GetProcessesByName(Convert.ToString(lstProc.SelectedItem))(0) proc.Kill()
  23. You could also use the DEBUG constant with the compiler #if statement to see if the application is in debug mode. Im just suggesting this because the compiler conditional statements are not compiled into the actual exe so once you set up a statement like that you don't have to edit anything (like commenting out a line that checks if the compiler is attached), and the compiler will decide what to compile. #If DEBUG 'application is compiled in debug mode #End If
  24. There is no Managed DirectX7. Managed DirectX9 is the only version meant for .NET.
  25. Do you want to show frmUpdater as a dialog? If yes then simply pass in your main form as the first paramter into the ShowDialog method, and then from your frmUpdater you can access the form you passed in using the Owner property. If you don't want to show it as a dialog, then the best way would be to edit the constructor of your frmUpdater to accept an instance of your main form, assign the passed in instance to a variable and use it from there.
×
×
  • Create New...