snarfblam
Leaders-
Posts
2156 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by snarfblam
-
Thread always appear to have new posts.
snarfblam replied to Cags's topic in Suggestions, Bugs, and Comments
I'm pretty sure that it is the poll. I noticed that it was always in the "Get Net" search, and although there usually weren't new posts there was always more votes. -
If you are using .Net 2005 you can set the AutoCompleteMode to "Suggest" and AutoCompleteSource to "ListItems".
-
Maybe you need to go to your windows settings (I believe that it is under folder options in the tools menu of explorer) and disable the option to hide system files.
-
It is misleading, only because, as Cags said, in this respect the framework isn't particularly consistient. Strings work this way because they are immutable and therefore must, but rectangle structures don't. And, PD, that analogy makes sense except that to be consistent with ints in that manner means to be inconsistent with most other structs, and vice-versa. Here is my interpretation of the analogy. TimeSpan tsA, tsB; int iA, iB; // TimeSpan overloads the + operator. // Considering this, here is the analogy between TimeSpan and int: tsA = tsA + tsB; tsA += tsB; iA = iA + iB; iA += iB; // With this logic we can't consider the TimeSpan.Add method equivalent to // the addition operator in the Int32 struct, but we can compare TimeSpan // to other structs, for example: Rectangle rA; rA.Offset(5, 5); // Modifies the struct and returns nothing. dtA.Add(dtA); // Does not modify the struct and returns the result of the addition. // Were the Int32 struct to contain an Add method, how would it work? Like a rect or a DateTime?
-
So, mskeel, which category do I fall into? I guess I'm not a true expert and never will be because I program purely for hobby and have no experience in the professional aspects of programming (team programming, testing, company standards, etc.).
-
On an array? Or an arraylist/generic list? We are talking about normal arrays.
-
I think that DateTime might have that whole immutable thing going on, similar to a string, but why they would do that with a value type I don't know.
-
Be wary of adding items to a project as a link. Generally, a project folder can be moved as a whole. It will contain every file relevant to the project within. When you begin adding files as links you now have relative file references which means that if you move or copy the folder (for example, zipping it and uploading it), the project will cease to work. I suppose it would be reasonably acceptable to have links to files from other projects within the same solution.
-
Generally, each project has its own folder (usually within the solution's folder), although it is possible to place them both in the same folder. It is also an option to show all files, including those that are not part of a project. If you have the option enabled to display all files then an item should should appear grayed out in any projects which it is not a part but whose folder it is present in. If the projects are in different folders and you add an item from the first project to the second, you can either add it normally, which will place a copy of the file in the second project's folder, or you can add it as a link, where it is a shortcut pointing to the original file (it will be displayed with the Windows shortcut icon). Most likely, you have the two projects in different folders and are adding the item from one project to another normally (i.e. not a link) which means that the file will be copied. If you exclude it, it will still be present in the second project's folder, hence it is displayed grayed out. If you delete it, it should not delete the original.
-
Consider researching the AppDomain class.
-
VS2005: how to display splash screen for few seconds
snarfblam replied to kaisersoze's topic in Windows Forms
You don't explicitly show the spashscreen yourself, do you? Assuming the answer is no, maybe you should carefully check any code in the splash screen (consider checking designer code too, just to be sure) and make sure there is no code that would prevent the form from closing. -
I should have said this, but I am using C# express. The option is present but does not work in the object browser and is not present in the class viewer window.
-
VS2005: how to display splash screen for few seconds
snarfblam replied to kaisersoze's topic in Windows Forms
Why not explicitly close it yourself? I don't have any experience with the "Application Framework" feature, but you might be required to run this line of code yourself: [color=Blue]My[/color].Application.SplashScreen.Close() -
IComparer isn't necessarily a better solution, Cags. Your solution will work approximately equally fast. IComparer is quicker and easier to write, but your solution will be more scalable because it would not require a complete re-sort if, say, we were to add files from another directory to the ArrayList. But I would have to say that to gain maximum efficiency (CPU-wise) a LinkedList or BinaryTree would be best.
-
For #2, you have two choices. One, set Form2's startup position property to CenterParent (via designer) and set the form's parent as the instance of Form1 (via code). Two, you can do the math out yourself, but positioning forms before they are shown has a tendency to work inconsistently at best and positioning them after they are shown looks unprofessional. For #1, I haven't tested this. I'm just throwing it out there. You could explicitly show both forms (possibly in Form1's load event) and then set focus to Form2.
-
You do not need to 0x in number parsing functions. This is a C# (or c-style to be clearer) hexadecimal notation, not a .Net notation. VB uses a different notation (&H1234567) and other languages use other notations (such as $1337), and the .Net framework does not cater to a particular language. To parse something as hexadecimal, you best be is to use the integer.Parse method, which allows you to specify a number style (including hex). I'm not sure quite how you are working out the integer and decimal parts from the hex value, but this might be a good starting point. string startWithThis = "2f0b"; int intValue = Int32.Parse(startWithThis, System.Globalization.NumberStyles.HexNumber); double becauseYouWantItAsADouble = intValue; And because knowing is half the battle, in case anyone doesn't know, here is how you can make a round trip with hex strings and integers. int someInt = 0x1337; string someHexString = someInt.ToString("x"); // use "x" for lower case hex and "X" for upper case hex int thatIntAgain = int.Parse(someHexString, System.Globalization.NumberStyles.HexNumber);
-
There are a couple of reasons that I can think of. First of all, overriding allows you to consume less resources. No extra objects are created (delegates/multicast delegates), no check for a null delegate must be made before invocation (this is done implicitly in VB and should be done explicitly in C#). Another reason is that events can be manipulated in ways that v-tables (the mechanism used for choosing a function from a list of overrides) can't. For instance, if I can get access to your MouseMove method (even private members can be accessed via reflection) I can detach it from the event. Cags had the right idea here. Of course, if you want to do something like use the same method to handle multiple events, there is no great reason why you shouldn't use a single event handler instead of multiple overrides. Overrides are just the method that is generally preferred. (Yet, ironically, the designer handles events of the declaring class via event handlers instead of overrides.)
-
Why not create a structure to hold this information... [Vb] Structure FileInfo Dim Filename As String Dim CreationDate As DateTime End Structure [/code] And an IComparer that can be used with the ArrayList.Sort function Class CreationDateSorter Implements IComparer Function Compare(ByVal a As Object, ByVal b As Object) As Integer Implements IComparer.Compare Return DirectCast(a, FileInfo).CreationDate.CompareTo(DirectCast(b, FileInfo).CreationDate) End Function End Class
-
Just to offer an alternative for anyone who stumbles in, there is also always the for each loop. Dim Things As String() = {"cow", "jumps", "over", "moon"} For Each Thing As String In Things SomeComboBox.Add(Thing) Next
-
The normal DirectX DLLs do not include managed DirectX. Most DirectX applications will not use managed DirectX, so managed DirectX will not be installed with most DirectX software that installs DirectX for you. Managed DirectX is a wrapper for DirectX that allows you to use it in a managed environment, essentially an add-on, therefore not normally included. I don't know if a DirectX download from Microsoft will include the managed DLLs. If the user has DirectX installed they do not necessarily have the managed wrappers (managed DirectX DLLs) installed. If they don't, you need to distribute the managed DLLs. Whether they are available as a separate install or only in a full DirectX download I do not know. You probably can not only distribute individual files because it is probably a violation of the license. If you want to distribute the files it is your responsibility to read the license. Why the license is written the way it is is not up to me, but one probable reason is that Microsoft most likely does not want users to have different version of different components of the same library.
-
Maybe this will help. Property Bending
-
Appearently this is a known issue (its somewhere in here). I think you might just have to suck it up. By the way, even though the OS is meant to be used with a stylus, from a program's point of view a touch screen still works the same way as a mouse. If the control supports mouse events, they should also work with the stylus.
-
DirectX, like most any programming library, is a whole unit, even if it is split up into multiple DLLs. Just as the Dotnet libraries would not work without mscorlib.dll, no DirectX libraries will work without Microsfot.DirectX.dll. Besides that, distributing a single DLL is probably a violation of the license, hence illegal. Microsoft probably has a redistributable installer for managed DirectX (as they do for the Dotnet framework). If anything, that is what you should be passing out with your application. If you are distributing this application on the Internet, provide a link to a download on Microsoft's website. If you are distributing via CD then you are going to have to cram the files on there.
-
As far as interacting with the database, that is not my area of expertise, but I do know that it is a good idea to track your textboxes some how. Your best bet in a case like this seems to be to use an array. In our simplest case, it would look something like this: [Vb] 'Declare an array at class-level scope so we can use it in other functions Dim myBoxes As TextBox() 'This code will be run when you want textboxes Sub MakeMyBoxes() Dim boxCount As Integer = 10 myBoxes = New TextBox(boxCount) {} 'Create an array For i As Integer = 1 to boxCount Dim MyTextBox as New TextBox myBoxes(i) = MyTextBox MyTextBox.Id="txtbox" PlaceHolder.Controls.Add(MyTextBox) Next [/code] Now that you have them stored in a variable in the form, when you want to store them in the database (say, for example, when the user clicks submit) you can loop through the textboxes in the array, get the .Text proprerty, and process it accordingly. If you want a better handle on dynamic control creation you might want to read this tutorial that I wrote.