Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[4375] Building Windows Applications

Last post 06-24-2008 3:09 PM by elaine_tz. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [4375] Building Windows Applications

    This thread is for discussions of Building Windows Applications.

    • Post Points: 55
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 04-01-2004 5:52 AM In reply to

    Tip of the Day Form

    I want to create a Tip of the Day Form for my application, which reads the tips from the tips.ini file and every time the application is started the next tip ( based on the previous time when the application was started) is automatically dispayed.
    please help
    any help will be highly appreciated, it is very urgent.
    thanks
    meenakshi
    • Post Points: 0
  • 07-22-2004 10:13 AM In reply to

    data input checking

    I read your article and it was very useful, thank you!  I would like to take it further though and check that all the fields were filled in and that they are numeric, if need be, etc.  I am having trouble in that I can't stop the form from returning a dialog result if there is anything wrong with the data in the fields.  For example, if a user needs to enter their name, but the field is left blank, no matter what I do the form just returns a null value for the data.  Is there a way to keep the dialog form from closing and returning a result if the fields on the form are left blank?

    Thanks in advance for any help on this issue.
    • Post Points: 0
  • 12-25-2004 10:44 PM In reply to

    • roberts
    • Not Ranked
    • Joined on 11-21-2004
    • Junior Member
    • Points 100

    Appreciation

    I found this article to be very useful.  I had read the .net SDK stuff over and over and could not find this very simple, yet critical piece of information on form sharing.  Thank you for writing this up and providing an example.
    • Post Points: 0
  • 02-13-2005 4:52 AM In reply to

    • ben9
    • Not Ranked
    • Joined on 02-13-2005
    • New Member
    • Points 10

    multiple button groups

    I added two radio button groups, giving each group distinct names. I added two event handlers one for each group.

    When the program loads, as long as I change my selection within one group, it's fine. However, as soon as I move to the another group, I get this error.

    "An unhandled exception of type 'System.NullReferenceException' occurred in system.dll"

    The code breaks at this line.

    "If rbGroup1(iGroup1).Checked Then" if I clicked Group1 first and moved to group2.
    "If rbGroup2(iGroup2).Checked Then" if I clicked Group2 first and moved to group1.

    This was for pocket pc 2002.

    When I changed the platform to windows application (not pocket pc), VS .NET added this advisory.

    "Additional information: Object reference not set to an instance of an object"

    What am I missing? Could someone help?

    Thanks.
    Ben
    • Post Points: 0
  • 02-13-2005 6:27 AM In reply to

    • ben9
    • Not Ranked
    • Joined on 02-13-2005
    • New Member
    • Points 10

    multiple button groups 2

    Well I figured it out...

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbcongroupingcontrolstofunctionasset.asp

    said

    "You group radio buttons by drawing them inside a container such as a Panel control, a GroupBox control, or a form. All radio buttons that are added directly to a form become one group. To add separate groups, you need to place them inside panels or group boxes."

    So I added 2 panels to the form, and moved the radio buttons to corresponding panels, and the error went away.

    I think if you have only a few radio buttons, or your hand is faster than your brain and can paste/copy/modify mechanically (as I am),  the following seems way simpler. (no need to create an array)

    1. Add all radio buttons. If needed, separate them by groupboxes or panels (.NET compact does not seem to have groupboxes.)
    2. Add an event handler to one of the radio buttons as stated in the tutorial, and just add the name of the other radio buttons after "Handles" (see below)
    3. And use if elseif ...

       Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged
           If (RadioButton1.Checked) Then
               Label2.Text = RadioButton1.Text
           ElseIf RadioButton2.Checked Then
               Label2.Text = RadioButton2.Text
           End If

       End Sub

       Private Sub RadioButton3_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged, RadioButton4.CheckedChanged
           If (RadioButton3.Checked) Then
               Label3.Text = RadioButton3.Text
           ElseIf RadioButton4.Checked Then
               Label3.Text = RadioButton4.Text
           End If
       End Sub
    • Post Points: 0
  • 04-26-2005 8:10 PM In reply to

    • jarmar
    • Not Ranked
    • Joined on 04-26-2005
    • New Member
    • Points 10

    multiple forms

    I am trying to build an application with 4 forms.  I have only been able to get it so that all forms must return to form1.  What I want it to do is be able to select any form from any form.
    • Post Points: 0
  • 04-30-2005 5:26 PM In reply to

    • hydromat
    • Not Ranked
    • Joined on 04-30-2005
    • New Member
    • Points 10

    Multiple Form Instances In VB.Net

    Jarmar,

    I have strugeled with the same problem. I too have a project containing 8 forms and and every form in the project must be able to access the default instance of all opened forms. I did a lot of research and foun an article from msdn. Here is what I found works:

    #Region " Form2 Default Instance "
    Private Shared Form2DefInst As Form2
    Private Shared InitForm2DefInst As Boolean
    Public Shared Property Form2DefInstance() As Form2
       Get
           If Form2DefInst Is Nothing _
               OrElse Form2DefInst.IsDisposed Then
               InitForm2DefInst = True
               Form2DefInst = New Form2()
               InitForm2DefInst = False
           End If
           Form2DefInstance = Form2DefInst
       End Get
       Set(ByVal Value As Form2)
           Form2DefInst = Value
       End Set
    End Property
    End Region

    I put this class wrapped in a region in my startup form (Form1) for each form that had to be accessed. The code to create or call the instance is as follows:

    Form1.Form2DefInstance.show()

    The class will check for an existing instance and display it or will create it if one is not availible. I put the class in my startup form just below the "Windows Generated Code" region. You can also create a new class and reference that class in the same manner. Let me know if you have any problems.
    • Post Points: 10
  • 09-29-2005 6:38 AM In reply to

    • loga
    • Not Ranked
    • Joined on 09-29-2005
    • New Member
    • Points 5

    how to use service with window application

    any body tell me the solution how to use service with window application form interaction.
    • Post Points: 0
  • 01-18-2006 7:39 PM In reply to

    How do I create and Place New NonModal Forms On To

    I have a problem. I am using .Net 1.1 and VC++ .Net 2003 with both COM and OleDb objects. I have an request for a change to a management program that asks me to make the Meeting Notice or Meeting Minutes form the active form when a meeting entity is selected from the list of entities in the MeetingSelectorView form. I have been asked to have the new form selected to become the top form. Currently, the MeetingSelectorView form remains on top for reasons that I don't quite understand. I have been looking in the MSDN all morning, tried several different ways of doing it, and finally have decided to ask a question of a .Net expert rather than spin my wheels any longer. I will continue to look for a solution until I either find one that works or get an answer.

    Current method and Actions:

    The program queries a database for a set of Meeting entities and displays the list of retrieved entities in a grid in a MeetingSelectorView .Net form. The user selects an item by double-clicking on the row containing the required entity. The MeetingSelectorView activates an event that runs a method which creates a Notice or Minutes form object as requested, loads the data, and shows that object. Currently, the MeetingSelectorView form remains on top with the Meeting Notice or Minutes object below it.

    The requirement is that the newly created Notice or Minutes form be on top AND the ReviewSelectorView form remain active so other meetings can also be selected. The MeetingSelectorView form can be closed if the user selects the cancel button).

    The question, then, is how do I set the Notice for Minutes form to be the top form and where does the code go (in which object)?

    Ray Tillman
    • Post Points: 0
  • 05-21-2007 5:37 AM In reply to

    • gracie7725
    • Not Ranked
    • Joined on 05-21-2007
    • United States
    • New Member
    • Points 5

    Re: Multiple Form Instances In VB.Net

    Jarmar,

    I know this is an old post but I wanted to thank you for this piece of code. It is a great help to me.



    • Post Points: 5
  • 08-16-2007 2:12 AM In reply to

    • Kary
    • Not Ranked
    • Joined on 08-16-2007
    • United Kingdom
    • New Member
    • Points 5

    Re: [4375] Building Windows Applications

    This article was excellent.  Thank you.
    • Post Points: 5
  • 06-24-2008 3:09 PM In reply to

    • elaine_tz
    • Not Ranked
    • Joined on 06-24-2008
    • Tanzania
    • New Member
    • Points 105

    Re: [4375] Building Windows Applications

    This is a very useful piece of code - I followed the instructions and quickly had a solution to my problem of getting which radio button had been clicked.

    • Post Points: 5
Page 1 of 1 (13 items)