RE: Layout by code - a wonderful tool but....

  • From: Katherine Moss <Katherine.Moss@xxxxxxxxxx>
  • To: "programmingblind@xxxxxxxxxxxxx" <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 4 Aug 2011 16:46:51 +0000

Why not?  What if one is more comfortable (as am I when doing C# demo 
projects), using an IDE?

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Homme, James
Sent: Thursday, August 04, 2011 12:39 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: RE: Layout by code - a wonderful tool but....

Hi,
This is probably going to be a very silly question. Why are using VisualStudio 
at all with LBC?

Jim

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Bue Vester-Andersen
Sent: Thursday, August 04, 2011 11:40 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: SV: Layout by code - a wonderfull tool but....

Hi again,

Further to my problem with Layout by code.
This time I tried the original FruitBasketCS program without modifications.
When I go into the project properties and set output type to console 
application everything runs nicely, except for the anoying fact that a console 
window is created for the program which is not used anyway. When I change the 
output type to Windows Application the previously mentioned "invalid cast 
exception" occurs. Still, I can step through the program by using f10 and f11.

In the meantime I also found out that the so-called ParkingWindow apparently 
seems to be an invisible window, a kind of clip-board that is used when you 
move controls from one window to another. I must admit that I am getting more 
and more confused

 I hope someone can help me, please. I still think that using Layout by Code 
would be a great way for a blind person to make a user interface with a decent 
layout

Best regards
Bue


-----Oprindelig meddelelse-----
Fra: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] På vegne af Bue Vester-Andersen
Sendt: 2. august 2011 21:09
Til: programmingblind@xxxxxxxxxxxxx
Emne: Layout by code - a wonderfull tool but....

Hi,

First of all a million thanks to Jamal for his great work. LBC is just about 
the most fantastic programming tool I have ever stumbled upon. I am 
congenitally blind and have always found it next to imposible to work out a 
layout that would work at all.

Now for my problem:
I am trying to make a template for use with Visual Studio 2008 building on the 
template for a Windows forms application. Everything compiles fine, but when I 
run the resulting program I get the following exception (translated from 
Danish):

Invalid cast exception
{"an object of the type
'Microsoft.VisualStudio.HostingProcess.ParkingWindow' can not  be converted to 
the type 'Homer.LbcForm'."}

The exception occurs at the CompleteWindow() call. It looks to me as if I was 
referencing the form before it is actually created. The funny thing is that 
everything works fine when I step into the code using f10 and f11. I don't 
suppose there could be a race condition? Hope someone can help me.

Below is the code I am using. As I said, it is built on the Windows form 
application template. I thought that the use of component initialization might 
be the cause of my trouble, so I tried to remove all the designer and component 
stuff, but it didn't solve anything.

LbcForm1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Homer;

namespace LBCFormsApplication1
{
        public partial class LbcForm1 : LbcForm
        {
                public LbcForm1()


                {
                        InitializeComponent();
                        this.Init("LbcForm1", null, null);
                        this.AddMyControlls();

                }

                Private void AddMyControlls()
                {
                        // Add controlls here.
//                      AddButton("ok");

                }

                public void OnEvent(string sEvent, Control oSender, EventArgs 
oArgs)
                {
                        // Add event code here.

                }

        }
}

LbcForm1.Designer.cs

namespace LBCFormsApplication1
{
        partial class LbcForm1
        {
                /// <summary>
                /// Required designer variable.
                /// </summary>
                private System.ComponentModel.IContainer components = null;

                /// <summary>
                /// Clean up any resources being used.
                /// </summary>
                /// <param name="disposing">true if managed resources should be 
disposed; otherwise, false.</param>
                protected override void Dispose(bool disposing)
                {
                        if (disposing && (components != null))
                        {
                                components.Dispose();
                        }
                        base.Dispose(disposing);
                }

                #region Windows Form Designer generated code

                /// <summary>
                /// Required method for Designer support - do not modify
                /// the contents of this method with the code editor.
                /// </summary>
                private void InitializeComponent()
                {
                        this.components = new System.ComponentModel.Container();
                        this.AutoScaleMode = 
System.Windows.Forms.AutoScaleMode.Font;
                        }

                #endregion
        }
}


Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace LBCFormsApplication1
{
        static class Program
        {
                /// <summary>
                /// The main entry point for the application.
                /// </summary>
                [STAThread]
                static void Main()
                {
                        Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(false);
                        LbcForm1 oLbcForm = new LbcForm1();

                        // Add further initialization here.

                        // Uncomment to run as window.
                                oLbcForm.CompleteWindow();

                        // Uncomment to run as dialog.
//                       oLbcForm.CompleteDialog();

                }

        }
}


Best regards
Bue

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind


This e-mail and any attachments to it are confidential and are intended solely 
for use of the individual or entity to whom they are addressed.  If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it.  If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
 The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: