Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
I'm no ASP.NET expert - haven't used it for about 9 months. But if I remember right and I'm not getting too confused, you can use a grid control. It's not like an embedded object that requires IE. Instead, it was a server-side control that spits out the proper HTML for you so that you don't have to worry about IE, Netscape, etc. It will add attributes and elements as needed to format the table however you tell it (colors, columns to include, etc.). It even supports paging (show 10 records at a time with Next/Prev/Jump-To-Page-X) through server-side round trips (of course). We use(d) it for awhile. I moved on to another project in WinForms so I can't say how well it's worked 9 months into the project. Like anything, I'm sure they have their uses. If you have old ASP functions that build tables from Recordsets it may be easier to convert that code to ASP.NET. But I'd check out the server-side controls to see what they offer. -nerseus
-
I've never tried it, but all Image objects contain a Palette property that has an Entries array (of Colors). Have you tried changing this? You may have to change the PixelFormat to something compatable with a Palette - a gif should probably always have a Palette so it may not be an issue unless you plan on loading a BMP in the future. I think I heard that to change pixels individually, you have to use rectangles that are 1x1 pixel. I can't remember how to use it though :) -nerseus
-
I would steer clear of DirectX 7 books. Or, rent them from your library. A couple of DX9 books are due out in a few months. Until then, there is a TON of sample code with the SDK. Read the through the C++ help file, some of the "Getting Started" topics would be a great place to start as DirectX is quite large, a VERY full set of object, methods, functions, etc. that are a bit temperamental :) I'd check out the tutorial projects that get installed with the SDK. You have to locate all the samples by hand, but they have full projects in C# and VB.NET as well as C++. Also, there's a tutorial at http://www.directx4vb.com that I hear is pretty good. -Nerseus
-
Seems like it should work assuming MessageQue is a Queue object. Did you type your sample by hand, as I think Dequeue needs parens since it's a method not a property... but try as divil said, walk through code - or write out the Count before you get in the loop to see if it's > 1. -nerseus
-
The combo in VB6 didn't work the way you describe either. What you're describing is an auto-complete feature that's not built into the standard windows combo. I've seen people use the API to auto-select items as the user types, but I think the style being used was DropDownCombo not DropDownList. You would also have to check to make sure that partial entries don't "stick" in the text property because you normally want to force the user to pick something in the list, not allow "Cr" as a valid entry. The standard combo with style DropDownList has you press the same letter repeatedly to select the next item. For your sample, you press "c" twice to highlight Craig. There is probably a free ComboBox control written to use subclassing in .NET that does what you want. Try a search on Google for autocomplete ComboBox or something similar. -nerseus
-
I would think that: me.BackgroundImage.fromfile("Location") wouldn't event compiles since FromFile is a static method and can't be called on an instance. If you don't, make sure you have Option Explicit set (not sure where in VB but I know it's possible). If it is set and you couldn't even get the line to compile, make sure you mention it as well as any errors that are generated when it *does* run. They help more than "the image doesn't show up". -Nerseus
-
I assume dg is a DataGrid control. Use the dg.SetDataBindings method. At least, I think that's what you need. -nerseus
-
You'll want something like: Me.BackgroundImage = Image.FromFile("C:\images\image1.jpg") I don't know if VB needs to double up backslashes as well, which might mean use something like: Me.BackgroundImage = Image.FromFile("C:\\images\\image1.jpg") -nerseus
-
Set the Anchor to Top, Left, Right and Bottom. It will automatically grow as the form does. -nerseus
-
You'll need a reference of Form1 inside of Form2 or you can pass in Form1's Location and Size values to Form2. From that, you'll have to manually set Form2's Location based on the values. For example: // In Form2's constructor, after InitializeComponent // Assumes "f" is a Form variable that references an instance of Form1, probably passed in through Form2's constructor this.Location = new Point(f.Left + f.Width, f.Top); Note: Above is untested but looks right -nerseus
-
I'm not sure if this will work for you, but you can override the WndProc of your form to check for messages. Some won't get sent still as they're being passed on to appropriate controls - but you can try it and see if it works. I'm sorry this is C# - just noticed this is the VB forum. I don't know how to convert override into VB.NET :) protected override void WndProc(ref System.Windows.Forms.Message msg) { // Replace WM_LBUTTONDOWN with WM_POWER... (I don't konw its value) const int WM_LBUTTONDOWN = 0x201; if(msg.Msg == WM_LBUTTONDOWN) { // Do something Debug.WriteLine("hit"); } base.WndProc(ref msg); } -nerseus
-
I think you have to call SetDataBinding... -Nerseus
-
There is definitely no such feature - this is a holdover from VB3 that was left in for VB4, VB5 and VB6. I liked it for VB5 but gave up on it in VB6 and when I got used to it (about a week) I loved it! While it's sad that it's gone, I think you'll get used to the new IDE and really grow to love Regions which are MUCH more powerful than "hiding" code by function. The SDI interface is also gone - I know some developers that use SDI even in VB6. With all the new toolbars available in .NET, I can't imagine keeping track of them in SDI. -nerseus
-
Normally you would do this with two dates and BETWEEN or a combination of >= and <=. If you use a calculation based on Month, you will run into performance problems unless you store the month as a separate column. For example: Given your query, you could use something like the follwing - but you don't want to, trust me: SELECT tblIncome.Amount FROM tblIncome WHERE Month(tblIncome.[Date]) = 1 You could get the "1" in .NET pretty easy, from a Date variable. The problem with the above is that you're using the Month function on a column. This means that the database must grab every month in the table which involves some kind of conversion to figure out what the month is. An alternative would be to store the Month as a separate column, stored as a Number filed (or int in SQL Server) and query off of that instead. This is typical in a reporting database where you want performance and don't mind carrying around an extra column to support faster queries. The more typical query would do the following: SELECT tblIncome.Amount FROM tblIncome WHERE tblIncome.[Date] >= #1/1/2003# AND tblIncome.[Date] < #2/1/2003# The #1/1/2003# and #2/1/2003# can be calculated easily given your month of 1. If you need sample code on how to do this in .NET, let me know. Assuming you have no TIME portion in your Date/Time columns, you could also use BETWEEN, as in: SELECT tblIncome.Amount FROM tblIncome WHERE tblIncome.[Date] BETWEEN #1/1/2003# AND #1/31/2003# You'll have to use the Calendar object in .NET to get the last day of the month to get the #1/31/2003" since you can't hard-code "31" days. If your Date/Time column contains TIME information the above won't work since a date/time of "1/31/2003 1:00PM" will come AFTER "1/31/2003" which assume a time of midnight. If you need more info, let me know :) As a note: If you want data for a particular month regardless of year, you will HAVE to use the first query - the one I said you shouldn't use - because you want to ignore the year and go off of JUST month. If that's the case, you may want to consider adding a Month column that gets updated every time you Insert or Update a row. It depends on the amount of data you'll be querying really. One last note: Don't wrap your columns with parens. I'm not sure what you're trying to do but it looks a bit odd :) For the column named Date, you'll have to use square brackets since Date is a reserved word. You'll want the brackets around the column name as in: tblIncome.[Date] -Nerseus
-
I don't have any experience with Paradox so this question may be naive... does Paradox support a Boolean that ADO.NET recognizes? I know that DB2 doesn't support a "bit" column like SQL Server - you must use a char(1) and interpret the value yourself. -ner
-
ERROR: Cannot Implicitly Convert Type 'string' to 'int'
Nerseus replied to VisualDeveloper's topic in Visual C# .NET
This would be a good time to learn what try...catch does as well (take a look at the help). -nerseus -
For the record, you probably want the return type to be Integer, not IntPtr. divil was suggesting that some "As Long" params from the VB6 API declarations may need to be converted to IntPtr. It depends on what the API needs. For the vast majority of APIs, the return type will be Integer as most DLLs are C-style which return a success/error through the function return value. For that, you simply want an Integer so you can compare the value to 0 to check for success. It won't hurt to use IntPtr as the return (that I know of), but you might want to change it so it doesn't look confusing in the future. -nerseus
-
The upgrade wizard, in my opinion, is a menace :) It may get your project up and running (if it's small and simple enough) but, as divil said, it will be filled with non-standard code. If you use the upgrade wizard as a way to "learn" VB.NET, you'll be doing yourself more harm than good as you may not learn the "right" way to do things. As with most things, it's worth the time to learn VB.NET outside the scope of a "real" project. Once you've got the basics down you can consider an upgrade path - if you decide to go that route. With 20 large forms and 30 more "small" ones, you're probably better off keeping it as VB6. It may not be as "cool" or "fun" - and the IDE certainly seems "ancient" after you've been in VS.NET for awhile - but VB6 still works as good as it did before .NET came out. Good luck and have fun! And as you learn VB.NET (or if you switch to C# or some other language) and have questions, let us know so we can help :) -Nerseus
-
Have you set some breakpoints to see if you're: getting in the Mouse_Enter event, if you are getting in that sender's type is "SkinnedItem", and if so then SetItemProps is getting called and falling into the .BackgroundImage code? -ner
-
If you installed the full SDK, you should get a "New Project Wizard" for creating DirectX apps. The wiz allows you to pick a Direct3D project (among others) and start off with a Teapot. I'd suggest looking at the code given by the wizard as there is a TON of it there - everything from initialization to events and more. I don't believe there are any samples using the sprite class with DX9 but there are lots of samples with VB6 and the interface hasn't really changed. I've coded a sprite class in C# that builds the triangles by hand so if you decide to go that route and need any help, let me know. -Nerseus
-
In the DataAdapter's Fill method you can specify a table name. Also note, if you are filling more than one table, all tables will use the same name that you give plus a number. So if you specify "Customer" as the table name, you'll get "Customer", "Customer1", "Customer2" etc. In that case you'd have to manually rename each table (I may be off on the numbering there - can't remember exactly how it starts). -Nerseus
-
You could use an expression column. Add a new column to your dataset's table and set it's Expression property. For example (untested, but should be close): ... da.Fill(ds, rs, "EquipmentByType"); ds.Tables[0].Columns.Add("CustData", typeof(string), "SN + ' - ' + ExpDate + ' - ' + ModelName"); cmbEquipment.DataSource = new DataView( ds.Tables[0] ); cmbEquipment.ValueMember = "s_GUID"; cmbEquipment.DisplayMember = "CustData"; You can check out expression columns in the help for more info on what you can and can't put in them. For instance, if the columns "SN", "ExpDate", or "ModelName" might be null, you may have to wrap them with IsNull(SN, '') (for example) so that the whole string concatenation doesn't return null. I also changed the DisplayMember to point to the new column, CustData. -Nerseus
-
I've never tried it, but it looks like PowerBroadcastStatus might be useful. It's part of System.ServiceProcess. Check out MSDN Library to see if it will do what you want. -Nerseus
-
As Robby said, you already won it :) I bought VC++ 4.0 about 6 years ago (give or take). It was brand new, never registered. I think it was $199 - a great deal at the time. I registered it with MS no problem. Not quite sure where the guy got it, but it was a dutch auction with 6 items available so it wasn't like he bought it but didn't want it - just had an overstock I guess. Good luck and welcome to .NET! :) -Nerseus
-
Do you need help with DataSets, moving forward/next, binding, ...? There are a lot of possible answers :) If you need sample code for DataSets, look at just about any post in this forum - there is a ton of sample code. For anything else, just ask. -Nerseus