Nerseus
*Experts*-
Posts
2607 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Nerseus
-
You should try VolteFace's other method, TOP, as in: SELECT TOP 1 * FROM CHRONOLOGY ORDER BY RECINDX DESC This should work no problem. -Nerseus
-
Each time you call Add, it returns the node that was added. Using that node, you can add children easily. As divil said, your DataSet may be structured to make things easier (or even recursive), but here's a sample to show how to add 3 parent nodes. Each parent node will have 2 children. // Add a parent node TreeNode node = treeView1.Nodes.Add("hello 1"); // Add two children. // This works because both children use "node" as the parent // to add to. The "node" variable is not reset // til farther down. node.Nodes.Add("child 1"); node.Nodes.Add("child 2"); // Here, node is reset to be the *next* // parent node. It's a parent because it's // added directly to the treeView1 control node = treeView1.Nodes.Add("hello 2"); node.Nodes.Add("child 1"); node.Nodes.Add("child 2"); node = treeView1.Nodes.Add("hello 3"); node.Nodes.Add("child 1"); node.Nodes.Add("child 2"); -Nerseus
-
Removing tabs is fairly common - you just may not realize it's being done, depending on who you are. For instance, a file's property dialog box (right click any file in explorer and hit properties) may not show certain tabs like Sharing or Security if you don't have them enabled in your policy. I'm sure MS didn't write multiple versions of the dialog - they probably just removed the tabs that you didn't have access to. As for disabling, I've never seen it done that I can think of. I did have one client that really wanted to have a tab look disabled. Luckily we talked them out of it. But some people have super-smart clients that want things done their way, regardless of standards. That, like not being able to disable a tab, is unfortunate :) -Nerseus
-
Right-justify ListBox items? Is this possible?
Nerseus replied to donaldc104's topic in Windows Forms
Normally a DataGrid would be more "standard" but nothing says you can't use whatever control you like. I do see what you mean with the DataSet and DataGrid being a bit more cumbersome than a simple listbox. You could use an ArrayList for the DataGrid, but you'd have to define a custom object to put in there so that the Grid displayed what you want. And you're right about the RightToLeft property. It's purpose is for different languages, not for string formatting. But a ListBox wasn't meant to hold right-aligned text (that I've ever seen) so it worked well :) I'm not sure how many numbers you're displaying, but I can think of two other alternatives. A multiline textbox (readonly) might work. You could also try a ListView. It's a tad bit more work than a listbox but might be worth it. Good Luck! -Nerseus -
Right-justify ListBox items? Is this possible?
Nerseus replied to donaldc104's topic in Windows Forms
I tried the RightToLeft property (set to True) and that worked. I can't say I've ever seen a ListBox that was right-aligned though. What kinds of data are you putting in the listbox? Could you use some other control, maybe? -Nerseus -
Do you want only one CHILD window open at once, or one modal window open at once? Normally, an About box is a modal window. If you use ShowDialog() instead of Show(), it will open modally and that pretty much forces one instance at a time (unless you allow frmAbout to open itself :)) If you need to prevent child windows, ask again :) -nerseus
-
Attached is a sample VB.NET project. I actually use C# so I'm not 100% sure how to do things in VB.NET. But, the project does work. If you need C#, it's waaaaay easier for me and I can have that sample up in no time. The sample... It has 2 forms and one Interface. The interface is named ISearchUtil. When I wrote it, I wasn't sure what you wanted (didn't have an internet connection) so here's what it does: 1. frmMain implements the ISearchUtil interface. 2. The ISearchUtil interface defines two functions: GetDataSet and GetDataTableName. 3. frmSearch's constructor (method New) takes an ISearchUtil parameter. Basically, when frmMain creates frmSearch (in the button's click event), it passes a reference to itself to frmSearch's constructor. Because frmMain implements the interface, frmSearch recognizes it as ISearchUtil and not a Form. Therefore, you can NOT call any methods of frmMain from within frmSearch. If you need them, you'll have to define them explicitly in ISearchUtil or use some other mechanism :) frmMain contains a private DataSet variable. My assumption was that frmSearch needs to get some data from a calling form. That data is passed in through a DataSet. Since you need the opposite, change the method from GetDataSet to SetDataSet and have frmSearch call it, passing in its own DataSet rather than grabbing one from frmMain. Sorry for the confusion. If you need a better sample that suits your needs, let me know - now that I have my connection back, all is gooood. -Nerseus isearch.zip
-
I think Robby is enabling/disabling controls, which isn't quite what RichDay was looking for. Unfortunately, you can't disable a TabPage. You also can't set it to Visible=False. You have to actually remove it from the collection to which it belongs - the TabControl itself. Assuming you're defining your tabs in the Designer, your variable for each TabPage will exist Form-wide. Meaning, if you have code that needs to remove the tab and later add it, you'll always have a reference to the TabPage. This only matters if you had planned on creating your tabs in code using local variables rather than form-level variables. Here's some code: ' Remove a tabpage named TabPage2 from the ' tab control TabControl1 TabControl1.Controls.Remove(TabPage2) 'Here's putting it back TabControl1.Controls.Add(TabPage2) Unfortunately, I don't know how to get the tab put back in any particular place. I've only had to do this once and there were only 3 tabs, so I did a Clear and then added them back in the order I wanted. -Nerseus
-
appending records from one dataset to another
Nerseus replied to whizkid123's topic in Database / XML / Reporting
Or use the Merge method of one DataSet to merge the other one. You can merge DataSets, tables or rows. -Nerseus -
Is this for a personal computer, or something on a network? Can you take advantage of Microsoft Message Queuing? It's quite handy is made to store things asyncronously and keep track of things even if machines go out. I'm not sure what you're doing with the strings so I'm not sure if this is ideal... If you want to write to a file, why not just append, with some kind of delimiter so that on machine failure, you could read the file to see where you left off (looking at each previous chunk by delimiter) - or a database for that matter? -Nerseus
-
Uhm... why would you want to? I could see removing one or more tabs, but why all of them? -Nerseus
-
If frmSearch didn't need anything from the parent form except a reference with which to send back a DataSet, you could use an Interface. Define the interface with method GetDataSet and have frmMain inherit from Form (as usual) but also implement your interface. In C#, you use something like: class frmMain : Form, MyInterface { } Or, you could define a new class that inherits from Form and have your frmMain (and everything else that calls frmSearch) inherit from that instead of Form. Use that new type as the parameter to frmSearch. Of course, the new class could expose a GetDataSet method. The interface would be ideal since you could define as many of these interfaces as you want and have frmMain implement them all. You can only inherit from one type in C# though. If you need a sample project, let me know. -Nerseus
-
My company has been using it for years with NO problems. We even have them hosting our email though we could just as easily host it ourselves. Again, no problems in years... And no, my company isn't Crystal Tech :) -Nerseus
-
Multiple tags with same name in XML
Nerseus replied to whizkid123's topic in Database / XML / Reporting
All XML files must have a root node. You can add one like this (it doesn't have to be named Root): <?xml version="1.0"?> <Root> <Address xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <FirstName>dan</FirstName> <LastName>jones</LastName> <CompanyName /> <Address1 /> <Address2 /> <City /> <Region /> <PostalCode /> <Country /> <Email /> </Address> </Root> An alternative is to use a DataSet. You can create a new DataSet through .NET's designer window. Define the fields and save it as an XSD. You can create a DataSet from this somehow (I'm not sure offhand, but I know it's possible). Once you have your DataSet, you're home free. You can add, update, and delete rows. You can also Bind your controls directly to it or display a grid. To save the data, use the WriteXml method of the DataSet, which saves the data and the schema. You can also use ReadXml to get it back off the disk. Good Luck! -Nerseus -
Try GetPart = "Select PartNumber from Parts where PartNumber='" & PartNumber.Replace("'", "''") & "'" If you can't tel, there are some single and double quotes right next to each other above. If you cut and past to notepad you might be able to see them better. Also note that I may not have the syntax right for Replace. I don't use VB.NET and I'm a little lazy to try out a new test project :) -Nerseus
-
You should also specify the size, with: a.Size = New Size(64, 24) '64x24 pixels The new location depends on what you want. Normally you'll use an offset from the previous textbox. You might have something like: Dim lastY As Int32 = 0 'looping here Dim a As New TextBox() a.Text = items(0) a.Size = New Size(64, 24) a.Location = New Point(20, lastY) Controls.Add(a) '4 represents 4 pixels between each textbox lastY = lastY + a.Height + 4 'or use the following: 'lastY = a.Top + a.Height + 4 'loop til here How you're doing your looping and where you're creating your textbox will determine how/where you store that last Y value. -Nerseus
-
Did you discover if they host .NET pages? There's also search engine just for finding hosts. I think it's webhostdir.com if anyone wants to do a bigger search... -Nerseus
-
You can use Environment.CurrentDirectory to get the current directory. Make sure your mdb is in the \bin\Debug folder and not the code folder as well and then using "Data Source=prova.mdb" should be fine SELECT...INTO is SQL only to dynamically create a real or temp table. You'll want a regular SELECT statement and pull the value from the returned DataSet or DataReader. -Nerseus
-
Multiple tags with same name in XML
Nerseus replied to whizkid123's topic in Database / XML / Reporting
What does your XML look like? Could you possibly use the DataSet's GetXml() method? Or use the GetXml() method and apply a transform? I think the problem may be in your code so you'll have to post the relevant parts. There's nothing wrong with having more than one node with the same name in XML. -ner -
I'm not 100% sure, but I know Crystal Tech used to be made for developers, including the ability to send your VB6 code which they would compile and put into COM+ for you! They offer a .NET control center for "near system adminstrator" access to your website, but I don't know if they allow hosting .NET applications; you'd have to check their site for more details. They are very nice as far as other features (SQL Server, front page server extensions, etc). -Nerseus
-
If you're using ...Rows.Add(...Table[..].NewRow()) then you can check the status of the row to see if it's an insert or an update (this is built into the DataSet object). Also, how can you be sure that the first insert even works? Meaning, how do you calculate your primary key value to make sure it doesn't already exist? If at all possible, it's much easier to use an auto-incrementing column (Identity in SQL Server, AutoIncrement in Access). If you define your DataSet and binding correctly the ID on an insert will show "1" until it commits and then it should automatically show the new value (say 42356) once the Update() method has been called. -Nerseus
-
Rock on :) -Nerseus
-
Is the Windows application for a client or just for the "world" in general? If it's for a client, it's best to get with them and see what they prefer. If it's for the world, I'd stick with 800x600 for awhile. My mom and dad, for instance, run at 800x600 with large fonts and icons on a 21" monitor. Some people will never change :) -Nerseus
-
By context, I mean what is it you're developing? Is this something that supports DragDrop (by your original message header) or is it something to do with OLE Automation? And when does your error occur? As soon as your object loads or some time later, during an event or method call? -Nerseus
-
Here's a link to a post on another forum that has VB6 code to parse an animated gif and display it with transparency. I think he got the code from someone else and ported it to VB6 (or for his own needs). Regardless, it works and could get you started. Click here to download. -Nerseus