snarfblam
Leaders-
Posts
2156 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by snarfblam
-
You already have a computer, though. Put that extra 200 dollars into a pc and you could have a nice computer that can play any game ever released for pc, ever, as well as loads of other computer software. You can buy a pretty good graphics card for $200, with tv output and all. The only real advantage to consoles is that developers can make many more assumptions about the users hardware. Back onto topic, my opinon about other first person shooters: Unreal Tournament: Good, Doom 3: Great, Halo: Great, Halo 2: Bad, Halflife: Good
-
Do you have images with different resolutions in the imagelist? This might cause problems.
-
I'm on GameCube. No internet gameplay for me. :( Thats okay by me, though. As far as I'm concerned consoles aren't for internet gameplay. Thats what PC's are for. You add a harddrive, internet connection, microphone, etc to a console and you might as well be using a computer.
-
To change which event you are handling here you need to change a few things: -The signature of the generic handler must be correct. In the case of mousedown it would be Sub(Object, MouseEventArgs). -You must use the correct delegate for the handler adding sub. In the case of mousedown it would be MouseEventHandler -You must change the actual event being handled 'This is our event handler Private Sub Generic_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) '<--Need correct signature 'Place your code here End Sub 'This function will add the specified handler to a control and any controls it contains Private Sub AddGenericClickHandler(ByVal Parent As Control, ByVal Handler As MouseEventHandler) '<--Handler is out delegate For Each thing As Control In Parent.Controls AddHandler thing.MouseDown, Handler '<--Actual Event Next AddHandler Parent.MouseDown, Handler '<--Actual Event End Sub
-
For reasons beyond me, the imagelist does not store the images in their origional format. Go to the imagelist property and set the ColorDepth property to 24 or 32 bits per pixel.
-
Why use regular expressions? These simple string operations can be done with other functions and classes. The DirectoryInfo.GetFiles() method allows you to specify a filter which which is usually used to find a specific file type, but in your case you could let it filter out any files except those that start with your app name and end with ".log" Dim BaseDirectory As New DirectoryInfo(Application.StartupPath) Dim FileList As FileInfo() = BaseDirectory.GetFiles(GetExecutingAssembly.GetName.Name & "*.log") '^ Will find files that start with the assembly name and end with .log 'Create array holding names of all sub-directories Dim SubDirs As DirectoryInfo() = DirBase.GetDirectories() '^ I don't think you want the *.* filter here. Most likeley NONE of your subfolders will match this pattern. ' *.* is more suitable for filenames than path names. Two easy lines of code. If you need to extract the dates and times after this point, then use regex to find and extract matches to date/time string formats. Depending on the date and time formats you are using these may or may not work. Dates: "\d{1,2}/\d{1,2}/\d{2,4}" Times: "\d{1,2}:\d{2}:\d{2}"
-
Some controls, for instance, the combo box and the datetime picker, popup a window that allows you to edit their value. When this window pops up it can be outside the bounds of the form that contains the control. It also does not take focus from the application's main form. How can this behavior be emulated in a .Net application? edit: I should have said this: My difficulty lies in not stealing the focus of the main window.
-
The code I provided didn't work because of a typo. I edited it. Also, you can't remove controls from the collection during the for each or it causes issues, so here is some code that works. Dim ControlsToRemove As New ArrayList For Each Item As Control In Me.Controls Try If DirectCast(Item.Tag, String) = "Remove" Then ControlsToRemove.Add(Item) End If Catch ex As Exception End Try Next For Each Item As Object In ControlsToRemove Me.Controls.Remove(DirectCast(item, Control)) Next
-
Good point, however, lothos said he was using RichTextBoxes, which don't exhibit this behavior. Also, it might be worth noting that a non-multiline textbox can be resized provided that the .AutoSize property is set to false.
-
If these are the only buttons on the form then you could do something like this. I don't know if modifying a collection while iteration through elements throws an exception. If it does, add all the controls to an arraylist in the foreach and then do another foreach on the arraylist that removes them from the controlcollection. For Each item As Control In Me.Controls If TypeOf item Is Button Then Me.Controls.Remove(item) Next If you do have other buttons, you could give the controls to me removed a tag with the .Tag property (e.x. "Remove") that signifies that they should be removed and do it like this: For Each Item As Control In Me.Controls Try If DirectCast(Item.Tag, String) = "Remove" Then Controls.Remove(Item) Catch 'Ignore an exception, most likeley caused by a nonstring .Tag() End Try Next [Edit]Sorry, I accidentally put "DirectCast(Item, String)" in the code above.[/Edit]
-
Why do you program... what do you like about it?
snarfblam replied to realolman's topic in Water Cooler
I program for fun... I just like to use my brain. -
TimeSplitters 3 just came out. Good game.
-
What do you mean it is not resizing to fill the bottom? Are they not resizing vertically at all? Or only the one on the bottom?
-
Have you tried the code? All controls have a .Top, .Bottom, and .Height property, which are the only properties that this code uses. Just make the appropriate variable name changes and this will work not only on textboxes and richtextboxes but any sizable control. Buttons, Labels, Groupboxes, you name it.
-
AssemblyInfo.vb
-
Resizing textboxes This code assumes that your textboxes are called TextBox1, TextBox2, and TextBox3. Each textbox should be anchored to the top, left, and right, and not the bottom. Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles MyBase.Resize Static ExtraHeight As Integer = Me.Height _ - TextBox1.Height - TextBox2.Height - TextBox3.Height '^ Difference between form's height and total textbox height. 'Since ExtraHeight is static it will only be calculated once, immediately 'after the form is loaded and shown (which raises the resize event) Dim HeightLeft As Integer = Me.Height - ExtraHeight 'HeightLeft is what the sum of the textboxes' height should be. ' SuspendLayout() TextBox1.Height = HeightLeft \\ 3 TextBox2.Height = TextBox1.Height TextBox3.Height = (HeightLeft - TextBox1.Height * 2) 'The reason that we don't just give textbox3 the same exact height is because 'we want it to take up the extra 1 or 2 pixels leftover as a result of roundoff error. TextBox2.Top = TextBox1.Bottom + 8 TextBox3.Top = TextBox2.Bottom + 8 ResumeLayout() End Sub
-
Don't yell at me if this doesn't make sense, I don't know ASP. Is there not a way to do this programatically as they edit the text? If not, is there a way to just throw in some javascript?
-
No... That is not going to work. If you anchor to all four sides of the form, the textboxes will resize with the form, but their location (this is, .Location()) will stay the same. If the form becomes 50 pixels taller, so will the textboxes. They will expand and cover eachother (which one covers which depends on the order in which you added them to the form). If you want them to expand only horizontally, un-anchor them from the bottom. If you do not want them to expand at all, but want them only to be centered (horizontally), anchor only from the top. If you want to do something more complicated, for example, have each textbox take up one third of the form and have them all expand with the form without overlapping, you have to program them to do this on the Resize event (make use of the .BeginUpdate and .EndUpdate methods).
-
You do mean system tray, right? (because that is what samsmithnz is telling you how to do)
-
Microsoft Sans Serif!!!! Note that this is not the same as MS Sans Serif, which is a bitmap font (I beleive). Older versions of Windows use MS Sans Serif. I also don't know if there is a .Net function to find the user's specified font, or if the user can specify a default font. He can specify the menu font, title bar font, message box font, but I don't think he can specify a default control/window font.
-
Oh, im sorry, i didn't realize you were using ASP. (I know its in the asp board, i just clicked "Get New" and saw "Adding checkboxes to a listbox".) Sorry, I'm dumb.
-
I am using Application.EnableVisualStyles() followed by a doevents. When the program starts, there is a treeview docked on the form that contains a scrollbar on the bottom, which should not be there (there is not enough content in the treeview to require it). Additionally, the scrollbar does not use XP styles. When the treeview is resized to a size small enough that a scrollbar becomes necessary, the scrollbar partially takes on Xp styles. When the treeview is made larger again, the scrollbar finally dissapears. After this point, the scrollbar behaves as expected, visually as well as in the fact that it is only there when necessary. The workaround I have used in the past is to set the treeview width to 1 and then back to the original size after the form is shown. This doesn't look so great though, the form flickers for a split second when it is shown. Does anyone know a workaround or a property that can be modified to correct behavior?
-
I started with "Applesoft BASIC". My brother had an old Apple //c that he gave to me. I was about 10, which would mean that this was around 1994. I don't know if Applesoft BASIC really counts, but I would spend hours at a time poking and peeking in the computer and seeing what I could make happen. Change the cursor, cause the screen to scroll, directly access video memory, I even found many nifty machine language subroutines that I called. Eventually my brother found QBasic on the Windows 95 CD in a folder called "oldmsdos" or "olddos" or something like that; from there on to VB6, and here I am now with VB.Net. So technically I've been programming for about 10 years; I don't remember exactly, and I don't think interpeted BASIC on an obsolete computer counts. I've been doing VB for about five or six years.
-
Would the CheckedListBox control suit your needs?