Which form to show in treeview - c#

Hello,
I have created several forms.
In the afterselect event of a treeview control, I have placed the name of the forms.
depending on which name I click in the treeview, I would like the correct form to be loaded.
How do I modify the below code to get to what I need please?
Thanks
private
void tvLayouts_AfterSelect(object
sender, TreeViewEventArgs e)
string s = e.Node.Text;
Form1 frm;
if (s.ToLower() ==
"Form1")
          frm =
new Form1();
else
if (s.ToLower() ==
"Form2")
frm = new
Form2();
frm.Show();

Hi,
Use this code.
string s = e.Node.Text.ToLower();
Form frm;
if (s ==
"form1")
frm = new
Form1();
else
if (s ==
"form2")
frm = new
Form2();
else
if (s ==
"form3")
frm = new
Form3();               
                    if(frm != null)
                           frm.Show();
Regards,
Selva Ganapathy K
the compiler gives an error for the frm != null and it underlines frm
it says: use of unassigned local variable 'frm'
string s = e.Node.Text.ToLower();
Form frm;
if (s ==
"form1")
frm = new
Form1();
else
if (s ==
"form2")
frm = new
Form2();
else
if (s ==
"form3")
frm = new
Form3();               
                    if(frm != null)
                           frm.Show();

Similar Messages

  • To which Forms directory to put a text file to show using WEB.SHOW_DOCUMENT

    Need to show a text file using WEB.SHOW_DOCUMENT.
    In which Forms sub-directory should the text file reside and what is the syntax for the command?
    Is it like WEB.SHOW_DOCUMENT('http://192.949.99.19:8890/forms/abc.txt','_blank');

    Hi, I did this
    -- My OC4J URL when I run a form is this: http://192.168.11.103:8890/forms/frmservlet
    -- I want to open abc.txt. I put abc.txt in dir E:\Ora_Dev_10g_R2\forms which is my Forms home
    -- When I try WEB.SHOW_DOCUMENT('http://192.168.11.103:8890/forms/abc.txt','_blank') it gives
    The page cannot be found

  • Which form is running

    Is there a way to determine which form is running on the application server?
    Enterprise Manager will tell the user id, pid ... but it does not show which form is running.

    Yes the form module that is currently executing. In our system there over 100 fmx's that could be executing.
    Duncan, Thanks for the idea to use the DBMS_APPLICATION_INFO package, however that would require me to modify and compile all of my forms. I will probably implement this solution on the heavy use forms.
    Now that all forms are running on the application server, wouldn't it be great if Oracle built something into EM the could track which form is running and perhaps even determine which one are performing poorly.
    We can wish can't we.
    Thanks for everyone's help.

  • Finding which forms an element is on

    Hello from the Land of Lincoln;
    How can I find elements on forms? Is there a query for that?
    Also, can I limit the form search to only forms where the element is updated (and not display only)
    ex: element table_job_position shows up on which forms?
    Thanks
    Holly

    This is a query for the Forms forum, not here.
    You may want to have a go at producing documentation for your form
    Depending on the version, you want to use something like:
    ifcmp60 userid=user/password module=<formname> module_type=form forms_doc=yes
    Then you can look at the generated output and
    - easily grep or search for specific field names
    - with more difficulty, search for updateable fields
    Go to the Forms forum and ask again!!
    Regards Nigel

  • Finding which forms use an element

    Hello from the Land of Lincoln;
    How can I find where an element is used in forms? Is there a query for that?
    Also, can I limit the form search to only forms where the element is updated (and not display only)
    ex: element table_job_position shows up on which forms?
    Thanks
    Holly

    With elements you mean table columns?
    There is no easy way to find out what columns are used in what forms. You could make XML versions of the Forms (if you use Forms 9.0.4 or later) and use any text searching tool to search for a known column name in the XML files.
    There are third party tools that can do this. The function is usually referred to as Impact Analysis. Do a google search on "Oracle Forms" "impact analysis" and you'll find them.

  • CRM 2011: Can you control which form is used based not security roles, but on a field value?

    I see that you can control which form is used based on security roles, but can you control it based on other field values?  I'd like a new record to use a different form until a given status is updated.  I have a status of draft and active. So
    it would be nice if I could use form1 for those in draft, form2 for those that are active.  But I only see where you can control that via the security roles.
    I can code all of this via JavaScript, but having the ability to use two separate forms would be nice.  Is that even possible.
    Best regards,
    Jon Gregory Rothlander

    Hello,
    Recheck following article - http://gonzaloruizcrm.blogspot.com/2014/11/avoiding-form-reload-when-switching-crm.html
    Dynamics CRM MVP/ Technical Evangelist at SlickData LLC
    My blog

  • Cycle Count Entries Form not showing specific employee name in "Counted By" LOV List

    Cycle Count Entries Form not showing specific employee name in "Counted By" LOV List.But the Employee is active . Is there any setup for this activity?

    Hi,
    This is because the query is excluding the current site you are trying to modify since it is actually in the report.
    You can include in your query:
    or site_id = :Pxx_SITE_ID
    Where Pxx_SITE_ID is the item holding the site_id value and xx is your page number.
    Thank you,
    Erick

  • I am creating a form, it shows 1 page, but when I save it as a PDF Form there are 2 pages, 1 is blank. How do I get rid of the blank page in the form?

    I am creating a form, it shows 1 page, but when I save it as a PDF Form there are 2 pages, 1 is blank. How do I get rid of the blank page in the form?

    Hi,
    You may open the original form in FormsCentral and toggle to “Page View” at the lower right corner. Adjust the page content to make sure no page breaks in this view.
    Thanks,
    Wenlan

  • With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?

    With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?
    I have developed a form with fields hidden by default, that become visible based on box ticked or radio button selections.
    My problem is that, when I close the form and re-open it, it comes back to it's default presentation, regardless of the information already recorded in the form (including in the now hidden fields.
    How to correct that
    Thanks in advance for any hint you can provide.

    I've had the same problem. This solved it...
    Go to the "Form properties..." in the File-menu. Select "Run-time" to the left and in the box "Scripting" Preserve scripting changes to form when saved: choose Automatically (Script-based state changes are saved locally in an insecure fashion. This option cannot be used for certified forms).
    Hope it works for you to...

  • Why does the form link show up in 2 pages, but when I save the form as PDF it comes up as 3 pages?

    A few weeks ago, I asked the above question on why the form link shows up in 2 pages, but when the form is saved as PDF it comes up as 3 pages.
    The answer I received was that I can simply select the page break and hit "delete" button or click on the trash can icon at the top right corner.
    I tried to do this but, there is NO OPTION to select the page break and hit delete….
    I want to combine the page on my PDF because the header takes up one entire page.
    How can I do this? Can someone please help or walk me through this live?

    Wenlam,
    There is NO OPTION to select the page break and hit delete….
    Please see.
    I want to combine these page because the header takes up one entire page. 
    How can I do this?
    Trent
    Thank you,
    Trent
    Trent R. Smock
    602.359.2685
    You want to improve? Interrupt your "old patterns."
    Do something different.

  • Freight Carrier Form not showing all records

    The Freight Carrier form is not showing all of the data that shows in the table
    (ORG_FREIGHT). For the Organization that I am in (#23) the table shows 108 records but the form only shows
    35 records. Why? How can I make the form see all of the records in the tables? I am in the middle of converting 11.0.3 to
    11i.
    Thanks
    Shelby

    What version of Visual Studio and the Crystal for Visual Studio SDK are you using?
    -Dell

  • I never used this program before. I tapped on the "budget form" and decided I'd rather use the "expense form".  I can't figure out how to get to the page that you choose which form you want

    I never used this program before. I tapped on the "budget form" and decided I'd rather use the "expense form".  I can't figure out how to get to the page that you choose which form you want. How would I do that?

    Pct,
    In the Numbers spreadsheets window where all your documents are shown as icons, tap the Plus Sign.
    Choose Create Spreadsheet
    Select the template you want to use
    Jerry

  • My macbook air with snow leopard OS. migrated to OS lion and have installed Java RE. a Bank website while opening in Java shows one error which window activity shows some applets not opening. it was fine in snow leopard. will somebody help?

    My macbook air with snow leopard OS was purchased last year. Recently migrated to OS lion and have also installed Java RE. A Bank website while opening in Java shows one error which window activity shows some applets not opening. But it was fine in snow leopard. Will somebody help?

    My macbook air with snow leopard OS was purchased last year. Recently migrated to OS lion and have also installed Java RE. A Bank website while opening in Java shows one error which window activity shows some applets not opening. But it was fine in snow leopard. Will somebody help?

  • HELP! *EVERYTHING* disappeared from my sidebar except for my MacBook Pro icon, which is still showing under "Devices".

    *Everything* disappeared from my sidebar except for my MacBook Pro icon, which is still showing under "Devices".

    Richard,
    I had checked Finder Preferences to make sure everything was still checked, and it was. But as a result of your suggestion I decided to go back and uncheck them, relaunch Finder, restart my MacBook Pro, and re-check them. That didn't actually change anything, BUT, in moving my cursor around the sidebar I discovered there is a "show/hide" button to the right of the word Favorites which only shows up when you hover over it (a bad design imo) and I must have somehow clicked on it and pouf! All disappeared! So, thank you! I would not have discovered that absent your suggestion. All is now showing in my sidebar again.
    Babette

  • How to create a form and show it as a modal window in VB6?

    oform.modal  -> modal is read-only property
    help,please.

    Hi Santiago!
    HTH: How to create a form and show it as a modal window?

Maybe you are looking for

  • How do I save a video after editing it?

    I just opened up an mp4 file, trimmed it and now wish to save the edited video. However, it seems I'm only able to save the Adobe project file and not the actual video itself. If 'export' is what I'm supposed to do, how do I export it as an mp4 file,

  • To split a table as two tables with equal no of records

    Hi Everyone, I have a table with size of 100000 records which is reterieved from different tables thats why idx is not in a sequential order. for example idx 1 5 100 and so on i want to create two different tables with same number of records but i do

  • DS Open timeout in cRIO startup app

    I have a cRIO application that upon startup opens a collection of Datasocket references to local NSV's. When running from the development environment everything works as designed.  When I build and run as a startup app then I get Error 56 Timeout on

  • TS1398 My wi-fi does not work properly now I have updated my iPhone 4 can any one help

    My wifi does not work properly now I have updated my iPhone 4 to the iOS 6 operating system can someone please help me? Also on my maps I can not zoom in as image is so distorted

  • HELP PLEASE!!! Computer won't start up

    Help Please! My computer won't start up, when I click the start up button the light comes only once, sounds click (once) and that's it, no power up. Because of the age, I knew that the battery could be the reason, so I ordered the exact same battery