
Algar
Avatar/Signature-
Posts
28 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Algar
-
I have a small VB.Net application, couple small forms. Main form has a ListView, Listbox, statusbar, main menu and a 100k jpg. The load event populates the listbox and listview controls with 2-3 items each from an access db. The following is the memory at variouse stages: After Load: 21 megs Move form around screen: 22 megs Minize form:600k Maximize form: 4 megs Move form around screen: 4.1 megs Minimize form:600k Maximize form: 4 megs etc... The Virtual Memory remains a constant 10.5 megs at all times. I dispose the connection object and close the DB reader... why does it hog so much at first and reduce so much when minimimzed ? I read a previous post from a long time ago about someone having the same problem as myself, though it never really got solved so I thought I'd try now.
-
Ok, sorry, time to reduce font size :) thanks a lot !
-
In VB6 the combo or listbox control had a drop down style. I don't see a dropdown style in .net, and the only control I could find is for web forms. Is there another way or do I need to prevent editing of a combobox somehow ?
-
Ok, I guess the form designer code managed to trigger something cause I put a boolean var holding the db operation till the end of the form load and it works fine now.
-
To be more accurate, the error is: An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll Additional information: Specified argument was out of the range of valid values. with the line: sSql = "SELECT * FROM Courses WHERE Name = '" & cboCourses.Items(0) & "'"
-
Doh, thats the first thing I tried :) Brings around more problems then.... I have a sql string using ComboBox1.Items(0) during the form load which is giving me an out of bounds error, but its after the code which populates the list. If I call MsgBox (ComboBox1.Items(0)) after the form is loaded it works fine giving me the first Item in the list. How is this possible ?
-
VB.NET ComboBox I am trying to get the Text of a Combobox item by refferencing the index of the item. Sounds pretty easy but ive been fooling with it for half an hour now and no luck. Thanks in advance.
-
Ok so I forgot about IsNumeric.... my bad :)
-
sorry thats http://www.allapi.net
-
You can find all the API's you need as well as download the API list/viewer at http://www.allapi.com
-
With all these new .NET things im wondering whats the best way to test if a textbox contains any non-numbers. The best I came up with was: Dim i As Integer = TexBox.Text.Length Dim ctr As Integer For ctr = 1 To i If Asc(TextBox.Text.Chars(ctr - 1)) > 57 Or Asc(sender.Text.Chars(ctr - 1)) < 48 Then 'its not a number End If Next Seems like there must be a way to improve on this ?
-
Ahhh im pretty new to .NET. I didn't know about Strict, or the object methods. Thanks a lot !
-
Ok, everything works now after I removed the outside Trim. CInt(Trim(txtH1R.Text)) rather then: Trim(CInt(Trim(txtH1R.Text))) Not sure why exactly though, does the Trim return strings only ? If thats the case how would it allow putting a string into a Long variable ?
-
I have 9 Textboxes which hold numbers. I want to add the 9 numbers together and put the total in a 10th Testbox Dim R1 As Long R1 = Trim(CInt(Trim(txtH1R.Text))) + Trim(CInt(Trim(txtH2R.Text))) + Trim(CInt(Trim(txtH3R.Text))) + Trim(CInt(Trim(txtH4R.Text))) + Trim(CInt(Trim(txtH5R.Text))) + Trim(CInt(Trim(txtH6R.Text))) + Trim(CInt(Trim(txtH7R.Text))) + Trim(CInt(Trim(txtH8R.Text))) + Trim(CInt(Trim(txtH9R.Text))) txtTotal.Text = Trim(CStr(R1)) As far as I know "+" only appends when theres 2 strings. The CInt should take care of that, but for some reason its appending all 9 numbers togther. Anyone have any ideas ?
-
Very informative, though the second method was probably best, the third suited my needs well. Thanks a lot !
-
I have a "score card" type form, with 117 text boxes on it and I want to be able to change the focus to the next textbox after 3 characters have been typed in any of the boxes, as well as some other things... In Vb6 I beleive it would be something like as follows: Private Sub TextBox_Click (Index as *something*) If len(TextBox(Index)) = 3 then TextBox(Index + 1).SetFocus End If End Sub I've visted many websites that discuss control array's and provide work-arounds for .NET. One added a class that creates and removes buttons, other just say to make a routine that 'handles' all the controls you need, but the problem is I need to be able to reference other controls. (As seen above with .setfocus) If anyone knows a way this might be possible, please let me know. Thanks
-
I am have the following code: Dim Conn As OleDb.OleDbConnection Dim sConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _ System.Windows.Forms.Application.ExecutablePath & "\db.mdb" Conn.ConnectionString = sConn Conn.Open() This I figured out on my own just playing with things. Seems like I have created a connection object, set the connection parameters and opened the connection. Now I can't for the life of me find how to create a recordset or query the database at all. These simple functions are what I really need right now, but also if anyone has a website (other then msdn, which has already confused me enough for a lifetime) that covers all these basics it would be greatly appreciated, thank you.
-
Ok, thanks a lot, works great ! I had already figured out that regraphing on the move event worked, but your way is much less resource intensive
-
I am manualy drawing 2 graphs on a picturebox. I put the drawing code in a routine and call it front the _Paint() event. The problem is: When the form is first loaded its invisible, and when I move the form from halfway off the screen, it won't repaint fully. So basicaly I need a way to make this picturebox repaint no matter what happens Here is the relavent code: ======== Form Load ========= Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Call MakeGraph() Me.SetStyle(ControlStyles.ResizeRedraw, True) Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or ControlStyles.DoubleBuffer, True) End Sub ======== Control Paint ========= Private Sub picGraph_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles picGraph.Paint Call MakeGraph() End Sub Also to note, it works with other controls, just doesn't seem to want to go with picturebox
-
MinSize is the control size I beleive but as I went to look I noticed the MinExtra property which is the size of the undocked area, exactly what I want. All these new properties in .net uuhhhh :) Thanks !
-
I am trying to move a splitter control at runtime to maintain a minimum Splitter.Top position during splitter movement and form resizing. I put the following code in a sub If split.Top < 685 Then split.Location = New System.Drawing.Point(0, 685) And im calling this sub from the form_resize, split_splittermoving and split_splittermoved events. When I go to move the splitter and split.Top becomes less then 685 is starts flashing beween where my mouse is currently dragging it, and the 685 position (during the _splittermoving event) but when I release the mouse it stays in its position above the 685. Also resizing the form after the splitter has been released at a position higher then 685 does not reposition it. Thanks in advance for any help provided.
-
Btw Archer, love the sign :)