Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
You're welcome :) I wouldn't try searching after every keypress - I'd wait til they tabbed out (at the earliest) or better yet, wait til they press a search button. I've seen some people put a timer on a form. Every time the user types something, they restart the timer. If the timer goes off (usually after 1 or 2 seconds), they perform the search. That way, you give the user a chance to type a few letters before searching rather than doing a search after every keypress. I've never tried this, but you could give it a try if you wanted a more immediate response. -nerseus
-
Check out the DataBindings property of all controls. You can bind to any property you want, not just Text. You could bind one record to a textbox to change it's background color (if you so desired). If you want paging (moving forward/backwards through a DataSet's rows), look at the Form's BindingContext collection. -nerseus
-
In the constructor of your secondary classes you'll want to add the device as an argument. Each class can then keep a reference to the main class's device. For example, this would be your main class that defines the device. It assumes there's a class called Class2 that needs access to the device. public class mainClass { private Device dev; public mainClass() { // This class's constructor, create the device dev = new Device(...); // Create class 2, passing in the device Class2 c = new Class2(dev); } } Here's what Class2 might look like: public class Class2 { private Device myDev; public Class2(Device dev) { this.myDev = dev; } } Now Class2 can use the device wherever it needs it. -nerseus
-
As I said above, you want to use the Extreme Visual Basic forums which are for VB6. These forums are for .NET. Click here for the VB6 forums. -nerseus
-
As I said, you could do that but you'll be taking a hit on performance. It won't be a big deal for small amounts of data. but for anything large this would be unacceptable because of the reasons stated above. Good luck! -nerseus
-
First, are you using VB6? And if you're using Win2000 it's COM+, not MTS :) -nerseus
-
I believe you want this forum. The forum you're on is for .NET programming. While .NET can do COM components, I assume you were asking about VB6. And MTS is only for NT - if you're using Win2000 or WinXP, you may want to re-word your question (on the other forum) to ask about COM+. -ner P.S. In COM+, you right click a package (called an application in MTS) and click export. In MTS you get an EXE, in COM+ you get an MSI file and a CAB file. You'll have to read the help to know if you want a Server or Proxy object.
-
Lock Table during Insertion or Updation
Nerseus replied to vellaima's topic in Database / XML / Reporting
What kind of locking do you mean? By default ALL databases will lock a row for a single update - you'll never get column1 updated by column2 not updated. Maybe you meant locked while your users have it to edit or maybe locking multiple tables/rows so that two or three different updates are all part of the same transaction...? More info please :) -nerseus -
Can you post all your code from the form so we can take a look? -nerseus
-
Don't you want to do: Me.AutoScroll = True Me.HScroll = False Me.VScroll = False instead of Me.HScroll = False Me.VScroll = False Me.AutoScroll = True -nerseus
-
Are you binding your ListView from a DataSet (not even sure if that's possible)? If so, the DataTable supports a Compute method to sum up values all at once. -nerseus
-
For searching you're going to have to write you own SQL. Let's say you have a column called LastName and you provide a textbox to search. You can build a SQL string using something like this: Dim SQL As String SQL = "SELECT * FROM MyTable WHERE LastName LIKE '" & textBox1.Text.Replace("'", "''") & "%'" ' The resulting string looks like: 'SELECT * FROM MyTable WHERE LastName LIKE 'jones%' Replace the "%" with "*" if you're using Access. Use the SQL string in your DataAdapter to .Fill a DataSet. The .Replace(...) method replaces any single quotes with two single quotes so that the query will run. Without it, searching for the name O'donnel will cause an exception. -nerseus
-
Attached is a sample that shows how to show the call details in a table. I know you can show data in nested tables but I can't remember the exact format of the HTML binding to get it to work. I'm about 90% sure I've done this before (binding to multiple, nested tables in IE) but it was 2, maybe 3 years ago... -nerseus test.zip
-
If you really need to pass that much data around to every page, something definitely needs to be reworked :) If you're just passing data one time, you could use a hidden input field which has no real limit on the amount of data. There is an issue with requesting large amounts of data from a control. I can't remember the exact issue, but I know you had to do something special to pull more than 4k or so from a control (different from the querystring's maxlength). I think it had to do with treating the control like an array, but I just don't remember the details... -nerseus
-
There's no built in way to do this like there was in VB6 (or previous versions). You can define a form-level variable in your MDI parent form. When the user clicks the button, check if the variable is Nothing (or null in C#) then create the form and show it. If it's not Nothing, just show the form. There are other options, like using a static method of the child form to have IT control the one an only one instance. It's the same concept, but you'd call the static method of the child class which would instantiate a static variable (if not already Nothing or null) and show it. -nerseus
-
If you're not sure about when to use certain controls, you can always ask. It's much easier answering specific questions :) -ner
-
I tried this back when it was first posted - I tried about 20 different ways to dispose of the bitmap but couldn't. I tried cloning, copying, Disposing, etc. etc... I couldn't get it to work either. I knew there were a number of bugs in GDI so I figured that's all it was - never did figure this out. Also, check out the date Kesper. With this being Gweitho's only post and over a month ago, I don't think he's checking the thread anymore :) -nerseus
-
You can use GDI to draw onto surfaces fairly easily. For example (taken from the DX9 wizard generated code, mostly): Bitmap bmp = new Bitmap(1, 1, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp); // Do your drawing on g ... Texture texture = Texture.FromBitmap(device, bmp, 0, Pool.Managed); Most non-circular shapes can be drawn in Direct3D by breaking your shape into triangles. Obviously, squares and rectangles are the easiest (next to triangles :)). A hexagon or a more "random" object might be slightly harder. If it's convex, you could use a simple Triangle Fan. Don't forget Direct3D can draw lines as well - just use LineList instead of TriangleList. For circles, arcs, bezier curves and such you might actually do well to use GDI. I can't speak of the performance as I've never really tried generating objects and loading surfaces per-frame. If you're not worried about the framerate and only need to generate the shapes once to prepare a surface there shouldn't be any problem. -nerseus
-
Other than avoiding most VB6 controls (OCX files), I can't think of any "don't use" controls in .NET. They all have their place and purpose. In some cases you may need (or want) to develop your own control or buy a pre-made control. If so, I'd suggest trying to use a company that either offers source code to their controls, or offers a way to get the code if they go out of business. You wouldn't want to get stuck without source if you find a bug in a 3rd party control one day that stops your app from working. A common 3rd party control is a DateEdit control. The one that comes with .NET is sooo close to perfect, but doesn't support a "blank" or "null" date, which is often needed. Another common one is a combo that has autocomplete. Luckily, with .NETs inheritence, there are a plethora of samples for you to find that show how to implement this yourself. Now if you mean to ask when to use a group of radio buttons vs. a ComboBox vs. a ListBox, I'd check out google or MSDN for references on what good GUIs should look like. Microsoft has standards for when to use certain controls (a true/false value should not have a combo with "yes" and "no", but use a checkbox for instance). -nerseus
-
Well first things first. The constructor will get called before anything else in you code. The default constructor will call InitializeComponent which takes care of creating all controls (assuming you're not creating some on your own, but always using the designer). So any code referencing lstDrawing after InitializeComponent should be fine - including Form_Load. If you ARE creating lstDrawing "by hand" - meaning your Dim'ing the variable in some routine such as FillMyList - then other subs, such as Form_Load, won't be able to reference lstDrawing. If I draw a listbox on a form and try and set it's SelectedIndex to 0 in Form_Load, I get "Specified argument was out of the range of valid values" - still an error, but not the message you reported getting. Your message should only come if the variable lstDrawing isn't defined - never set to New. Check where you define lstDrawing and make sure it's getting set to New in InitializeComponent. -nerseus
-
What exactly are you trying to do with your do3 and check2 functions? If you're trying to validate a string, you might do better to just use regular expressions. From the function names, I can't tell anything and I'm too lazy to read through the code to see what you want to do :) -ner
-
Can you show us the code that fills the listbox and how you're setting the selected index? Also, are you binding the listbox? I don't mean binding the drop-down portion, but binding the actual selected value (using control.DataBindings.Add(...)). -nerseus
-
I think Names might be a reserved word. When I create an access table with the name "Names" and create a query, the default select shows "SELECT * FROM [Names]". It doesn't put brackets on other table names, such as tblNames, when I create queries for them. Note this is all from within Access itself. Oddly enough, I don't think "Name" is a reserved word. I'd double check against the Access documentation - things like this are best solved early so that you don't have to worry about a similar problem later. -nerseus
-
Using Environment.Exit(42) worked for me. I created a test project and compiled to WinTest.exe. I put the following in a text file and gave it a VBS extension (like test.vbs). Running it launches the WinTest.exe program and waits til it closes. The MsgBox does indeed show 42. Dim shell Set shell = CreateObject("WScript.Shell") MsgBox(shell.Run("wintest.exe", 1, true)) Maybe your other program isn't checking the return code, but maybe trying to receive a windows message? -nerseus
-
I wouldn't name your column "Key". The default SELECT statement is likely the problem, as "SELECT Key, ..." isn't allowed. You can code the SQL manually to use "SELECT [Key], ..." or just rename your column to a non-reserved word. -nerseus