Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. snowmaster

    form prob

    OK, I'm not sure if I understand your problem, but you need to do three things. 1. Create a property in the dialog (form) you wish to display so that you can extract the information out of a textbox. public class Welcome : System.Windows.Forms.Form { ... public string Payment {...
  2. snowmaster

    NextResult

    Hi there, Actually, you need to use NextResult for every result set you request after the first one. The fact that you use the GetXXX is good. These methods return typed information which do not require further conversion and thus are the ones to use if you absolutely must use a DataReader...
  3. snowmaster

    Running script while PC locked

    Hi there, You can create a Windwows service. That way, you can run it in it's own security context. There's a template (Windows Service) when you create a new project. You will also need to create an installation. There is a great article in the MSDN library which will walk you though the...
  4. snowmaster

    convert string to float

    Just to put my 2c worth... you can use the following: string str = "2.354"; float flt = float.Parse(str); The Parse method is handy because it exists for every built-in function and a few more objects besides. The Parse method for the float type also has an overload which allows you to...
  5. snowmaster

    get assembley version c#

    Hi, That is OK if you already reference System.Windows (as the Application class is defined in there) A more generic way is to use reflection: using System.Reflection; ... // There are a few possiblilities here. // Look at the doc for the Assembly class Assembly assbly =...
  6. snowmaster

    Instantiating an object whose type is not known until runtime?

    Hi, I think what you're trying to do is instantiate various objects depending on the situation. One way is to instantiate the object before you enter the AddItem method and pass it as an argument: MySpecialObject obj = new MySpecialObject(); anobject.AddItem(obj); ... public class AnObject...
  7. snowmaster

    How to identify TextBox,RadioButtons etc

    Hi there, You need to iterate on the Controls collection of the form. For instance: foreach (object obj in this.Controls) { if (obj is TextBox) { TextBox txt = (TextBox)obj; // do something } } Hope this helps. Cheers!
  8. snowmaster

    can I invoke a web service from a .net windows app?

    Hi, Yes. You can use a web service in a windows app. 1. Right-click on the windows project 2. Click on Add Web Reference 3. Type in the URL of the web service This will create a proxy class for you in your project which will handle all communicaiton for you to and from the webservice. If...
  9. snowmaster

    What about ASCX controls

    Hi, Since a user control (ascx) is a class and self-contained, the only way to communicate is to use properties. If, for instance, you have a Textbox (txtLastName) on your form, write a property to access it. public string LastName { get { return txtLastName.Text; } set {...
  10. snowmaster

    string limit

    Hi, Both the posts are right. However, because the string cannot change size once it is allocated, it is better to use a System.Text.StringBuilder if you want to concatenate or play around with the string. Allocation of a StringBuilder object is dynamic and much more performant. It has...
  11. snowmaster

    close-open

    Hi, I'm not sure at what moment you're trying to run this, but the controlling program needs to be in the same scope. For instance: If you were trying to display a splash screen, you would write the following: [STAThread] static void Main() { Form1 frm = new Form1(); frm.ShowDialog()...
  12. snowmaster

    Opening Form2 from Form1

    Hi, The trick is to work the .NET way and use a custom enumeration. This makes your code much more readable. For instance, Before the declaration for your first form (you can also create all enumerators ina seperate file), declare a new enumerator: public enum MenuSelected { None, ItemOne...

Part and Inventory Search

Back
Top