Dynamic UI - Win Forms

Hi,
Sorry if this is a cross-post.

Wondering if there is any way to genrate Windows UI from an xml file just as
one would load a Web UI as HTML from an XML using XSLT. Please do let me
know if you have any ideas. Assume that the xml contains UI info (i.e.,
which is the control to display the info on etc). One obvious, but tedious
way is to manually parse the xml and generate controls using new() and fill
in data, but am looking for more structured ones.

TIA
Krishnan

Thanks
Krishnan


0
Krishnan1 (5)
10/6/2005 10:33:59 PM
dotnet.xml 7266 articles. 0 followers. Follow

5 Replies
618 Views

Similar Articles

[PageSpeed] 24

Hi Krishnan,

Thanks for your post.

Based on my understanding, you want to dynamically serialize and 
deserialize the winform controls from Xml file.

Microsoft has released a KB of a sample project, which demonstrate the 
VS.net IDE design-time support. In this sample, we can serialize the 
designer in 3 formats: VB.net files, C# files and Xml files. It also 
implemented the function of deserialize the designer from Xml files. So 
this function may meet your need.

Normally, internally, it just parse the xml file and use Reflection to 
create each controls and initialize each properties. Link listed below:
"INFO: Code Sample That Demonstrates How to Create a Custom Form Designer 
by Using Visual C# .NET"
http://support.microsoft.com/default.aspx?scid=kb;en-us;813808

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

0
v-jetan (8)
10/7/2005 7:52:17 AM
Hi,
Thanks for your reply.

I was more concerned about a dynamic UI. Foe e.g., if I have an xml file
that contains (among other things) data and the control through which I
should display data, I should be able to do it in Winforms. (In case of an
ASP .NEt application I can write xslt for a control matching the control
name!). I found that I can do reasonably well by creating a schema for my
xml, genrating a typed dataset to the schema, filling the dataset with my
xml data and attaching it to a datagrid with (dynamically) bound controls.

However I should say, in this process, I now have hit upon another issue.

I am trying to get a typed dataset from an xsd. However, the VS 2003
Enterprise Architect IDE says that "The same table (Table name) cannot be
the child table in two nested relations". I googled this and found that the
XML viewer sometimes throws up this message. But, in my case, I get this
message when I am trying to get a typed dataset from my xsd. I do have a
multpile reference to a child element, but I do not see how it violates any
of the W3C norms. Could you please help me out?

TIA
Krishnan

""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
news:oThORQxyFHA.2924@TK2MSFTNGXA01.phx.gbl...
> Hi Krishnan,
>
> Thanks for your post.
>
> Based on my understanding, you want to dynamically serialize and
> deserialize the winform controls from Xml file.
>
> Microsoft has released a KB of a sample project, which demonstrate the
> VS.net IDE design-time support. In this sample, we can serialize the
> designer in 3 formats: VB.net files, C# files and Xml files. It also
> implemented the function of deserialize the designer from Xml files. So
> this function may meet your need.
>
> Normally, internally, it just parse the xml file and use Reflection to
> create each controls and initialize each properties. Link listed below:
> "INFO: Code Sample That Demonstrates How to Create a Custom Form Designer
> by Using Visual C# .NET"
> http://support.microsoft.com/default.aspx?scid=kb;en-us;813808
>
> Hope this helps
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>


0
Krishnan1 (5)
10/7/2005 9:48:44 PM
Hello!

> I was more concerned about a dynamic UI. Foe e.g., if I have an xml file
> that contains (among other things) data and the control through which I
> should display data, I should be able to do it in Winforms.

I didn't look very closely at the sample but it looks like you should be 
able to produce the XML wich is generated by the designer using XSLT 
from your data and deserialize it dynamically to an UI...
(You could also directly create C#-Code from XSLT and compile it 
dynamically)
Or you look at GTK#, wich afaik supports an XML-syntax for building 
forms. #develop also has something with XML-forms, maybe Qt#... (it 
would be easier than Windows.Forms because of automatic layout managers)


> I am trying to get a typed dataset from an xsd. However, the VS 2003
> Enterprise Architect IDE says that "The same table (Table name) cannot be
> the child table in two nested relations". I googled this and found that the
> XML viewer sometimes throws up this message. But, in my case, I get this
> message when I am trying to get a typed dataset from my xsd. I do have a
> multpile reference to a child element, but I do not see how it violates any
> of the W3C norms. Could you please help me out?

How does the XSD look like?
IIRC the message occurs for something matching this:
<root>
   <a>
     <a>foo</a>
   </a>
</root>


-- 
Pascal Schmitt
0
10/8/2005 12:09:08 AM
Hi,

The XSD has to obey not only the W3C norms, but also the DataSet schema 
norm. This issue occurs because of the xsd is invalid. You can also check 
the following KB article for more information.

http://support.microsoft.com/default.aspx?scid=kb;en-us;325696

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no 
rights."

0
v-kevy (347)
10/10/2005 7:46:01 AM
Thanks Kevin

"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:CaWzu6WzFHA.3928@TK2MSFTNGXA02.phx.gbl...
> Hi,
>
> The XSD has to obey not only the W3C norms, but also the DataSet schema
> norm. This issue occurs because of the xsd is invalid. You can also check
> the following KB article for more information.
>
> http://support.microsoft.com/default.aspx?scid=kb;en-us;325696
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>


0
Krishnan1 (5)
10/12/2005 6:46:29 PM
Reply:

Similar Artilces:

Convert form Quark Express
Can MS Publisher read/convert files created in Quark Express? How? Hi Craig (anonymous@discussions.microsoft.com), in the Microsoft� newsgroups you posted: || Can MS Publisher read/convert files created in Quark || Express? How? No, it cannot. -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" with no warranties, and confers no rights. ...

Moving Data From One Form To Another
Hi all, I have a form that shows student information (primary key = student ID). I have buttons on this form to bring up other forms that can be used to register student for certain events. The first form is data from a student table, while the ones for registering the student are connected to a table s called Students Registered for an event (primary key = Student ID + Event ID). The problem is, then when you open the registration form, you have to manually put in the Student ID as input. I would like to pull whatever Student ID was currently showing in the Student form to be automatically p...

Collecting data from Excel form
I am working in Excel 2003 and would like to know if there is a way to create a form for data fill-in so that the data would then be collected in a database elsewhere. Thank you, Ricki Ricki, You can go to http://smartusemicrosoftoffice.blogspot.com/2010/03/linking-data-from-form-to-database.html to see it is the solution you want. Hope can help me. Thanks for the post. his is the task I would like to accomplish, but there are no instructions on how to accomplish this task., just a screen shot on what will happen. Where can I find the instructions to get this to work?...

Purchase Order Form
Where do you add a new PO Form that you manually created so that when you go to print a PO you can choose it instead of "Blank Form" or "Other Form"? ...

Email Coding works in one form but not the other...
I have this code in one form and it works perfectly: Dim olkApp As New Outlook.Application Dim mailNewMail As Outlook.MailItem Set mailNewMail = olkApp.CreateItem(olMailItem) With mailNewMail .To = "jfoster@monitronics.com;sroberson@monitronics.com" .CC = "" .BCC = "" .Subject = "Save Alert - Please Confirm" .Body = "Agent: " & Forms![frmLogIn]![Combo22] & vbCrLf & vbCrLf & _ "CS#: " & Forms![frmwinbacksave]![cs#] & vbCrLf & vbCrLf &a...

Report Writer (Modify Stock PO Form)
I need to add a comment to all PO's forms. (ie. "All corespondents must reference the above PO number.") Can someone walk me through the process from start to finish or show me where to find this info. thanks, GP9.0 SP3 -- Christian S South Carolina Christian, If this is a comment that will be used very often, then you can create a comment ID in the Comment Setup window (Tools > Setup > Company > Comments) by entering the Comment ID, i.e., POREFRNCE. and setting the series to Purchasing. When you create your PO, you can select this comment ID from the lookup. ...

Saving Input on User Form to Hidden Worksheet
I have a User Form that once it is filled in, it updates several other Work Books from different Control Buttons. I need to save the Input on the User Form in one of the Wook Books, so that if the Work Book is opened again the User Form automatically Fills back in. Would the Information on the User Form be saved on a hidden Work Sheet in the Work Book that I want to save it in? Any Ideas on how to achive this? You must write code to save and reload informations like this. Lots of ideas. Where to save is a question of what's practical. You can write to a sheet in the ...

RE: Excel data exported to custom Outlook form
Greetings earthlings, I have an issue that I have been trying to resolve for sometime, I think I will provide the scenario and hope someone has an answer. Here it is. - I have Excel workbook called "users.xls" - I have a worksheet called "location" - I have a cell B10 in the worksheet who's contents I want to be exported to a textbox called "state" in a custom Outlook form called "RFCO" that resides in the personal forms library in Outlook. (this custom form is from an email template) - I then want to be able to email the form. How do I c...

help on my forms and subforms
Hi. I have a form generated from one table and a subform within it that shows data from a different table. I need to generate a query or a filter that will only show fields that fall within two dates on my subform. How do I do this? The form has employee Id information and the subform has information from a table with time sheet information. I need the filter or query to only show dates within a pay period. Thanks for your help. Use a query based on the table for the subform instead of the table that filters based on your pay periods. -- Dave Hargis, Microsoft Access MVP &quo...

Best way to play Video files on an Access form?
Hello, My client has an Access front end with an SQL Server back end that will be storing Videos. The client wants to play those videos on an Access form. I know I can use Windows Media Player, but just wondering if anyone has experience doing this that has some insight on what the best way to handle this is. I know Media Player can be a bit of a pig, so if there is a better solution, I would love to hear it. Thanks! Rico ...

PLEASE HELP: Design a Student Screener in forms module
Hi All, I have a Student2009 Database With the following Data elements: FName LName SID HeightIn WeightLb DaysPresent DaysAbsent Percent TotalCourseNo AvgBaseBallScore AvgBasketBallScore So now I want to design a screener which will help me find the students I want based on what I select. I have already started it by designing a custom form in forms module where I can select the criterias like BaseBallAvg1, BaseBallAvg2, BasketBallAvg1 and BasketBallAvg2, Height1 and Height2 etc . here is my code, But it is not working yet and I need some help with it. PLEASE HELP!...

Excel macro or command button to search using a user form
I have a user form which shows info about each student. I want to be able to enter a student's name in a textbox and have all the fields on the form populated with the student information. You need to be a lot more specific on what you are wanting else we have to make a lot of assumptions. I would recommend using a combobox instead of a textbox. This way you can utilize the Change Event and have the students info. automatically filled in the rest of your userform. I will assume you have a list of students in Sheet1 in Col. A. Just set the RowSource property of the c...

Why FORM's verticle slider hidden (can not find the verticle slider)
I use ACCESS FORMs a lot. However, today I met one strange thing: The FORM is very large, long and wide. So, I set the attribute of the FORM to be available for both of the "level slider" and the "verticle slider", so that the user could pull the drag the slider to explore all the contents of the big big FORM. To my surprise, the "level slider" ( move the window to the right and to the left) is OK, BUT the "verticle slider" ( move the window to the top and to the bottom) is hidden!!!! I can not find the "verticle slider"! That is to ...

Dynamics Great Plains v10 trial version
I just recently downloaded (from the MS website) the 90-day trial version of GP v10 to my personal computer. The install appeared to go well however, while the login is "SA" I do not know the password. I have tried "password" and tried leaving it blank. Anyone know the answer? When I called MS Business Solutions, they told me that it will ask me to set up a password during the install, it did not. Thank you Did you try 'sa' as the password? -- Bud Cool, Accounting System Manager HDA, Inc. Hazelwood, MO GP 9.0, SP2 "Pam" wrote: > I just...

Forms and passing data
Hi. I have a form that has a button on it that opens another form, which you can then add data about the first form...for example... A form that pulls information from the Company table the button opens A form that pulls information from the contact table *specifically* for that company The company name is NOT repeated in the second form, but it is there in an invisible field. My question is, when I want to add a new contact for the company and I use this form, it is not automatically putting in the company name. Is there a way for me to automatically pass this information on to new e...

Modifying the case form title
Hello everyone, is there anyway to add a field in the Case Form title? Instead of having : "CASE: FMD-0001-3jHEUG" , I would like to have something like "CASE: FMD-0001-3jHEUG for Mr. Smith" which would be of course the customer name. Thanks! You can change the window title. Just put document.title = document.title + ' for ' + crmForm.all.fieldName.DataValue; However, the name of the customer is not directly available on the case form, so you would need to retrieve that, e.g. using a client side webservice call. HTH, -- Jeffry van de...

Warning/Startup Forms
I recently created a db for work and wanted a warning form to be shown if a particular event happened on the day it was opened, or conversely a 'No Events' msg box. 'Allen' kindly supplied me the code to do this however I now need to activate the switchboard after the msg box 'OK' button has been clicked. The code I am currently using is below and any help would be greatly appreciated: Private Sub Form_Open(Cancel As Integer) If Me.Recordset.RecordCount = 0 Then 'MsgBox "No Events" Cancel = True End If End...

how to automate tax deduction form?
i want to automate my tax deduction form.can any one help? Are you using Microsoft Access to create the database? If so, post details of what you need to do. If not, you would do best to find a newsgroup appropriate to the software you are using to create the form. "bhanu" <bhanupriya11@gmail.com> wrote in message news:1183711105.458449.30610@g37g2000prf.googlegroups.com... >i want to automate my tax deduction form.can any one help? > On Fri, 06 Jul 2007 01:38:25 -0700, bhanu <bhanupriya11@gmail.com> wrote: >i want to automate my tax deduction form.c...

Sales Tax Issue with Dynamics RMS
Here in California, the sales tax recently increase from 8.25% to 9.25%. I made this appropriate changes to the sales tax settings in RMS. The issue is when I get a return for items purchased prior to the sales tax change, the customer is credited at the current sales tax rate of 9.25% rather than the 8.25% that they should be credited. I need to be able to adjust the sales tax percentage at the POS for these returns so that the sales tax amount is correct. Any suggestions? Paul: How about setting up an "Old Tax" code at 8.25% and using Shift-F12 to select and apply the old tax...

VSTO
I retrieve a PivotTable in Analysis Services. How can i get the Pivotitems in spreadsheet to hide/unhide? I maked a loop in the pivottable, but the interop disable th pivotitems -- zeri ----------------------------------------------------------------------- zeric's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3100 View this thread: http://www.excelforum.com/showthread.php?threadid=50675 ...

Hide subforms control from main forms control
I have no idea how to hide some controls in my subform if value in a textbox in main form is >1 or =1.I can't write a code. Please help. Ciao New_Access wrote: > I have no idea how to hide some controls in my subform > if value in a textbox in main form is >1 or =1.I can't write a code. > Please help. Private sub form_current() if youControlName => "1" then forms!NameForm!SubForm.form.YouControlName.visible = false end if end sub -- Ciao Geppo geppo, why does access think my FormName is a fieldname. "geppo" <ccc@tin.it.inva...

Form design to add data to 3 tables in "Order Entry" style db
Sorry if this is a duplicate. I thought I posted it yesterday but couldn't find it today... I need help figuring out the best way to design a form for data entry in the "Order Entry" style, adding data to three related tables. For clarity I have eliminated several fields. Here are the three tables, plus the fourth that is a reference table: tblCustomers: CustID (pk), CustName tblOrders: OrderID (pk), OrderDate, CustID (fk) tblOrderProd: OrderProdID (pk), OrderID (fk), ProdID (fk) tblProducts: ProdID (pk), ProdName Each Customer is associated with one or mo...

Forms completion
Here is a question for you, we have a pretty simple database to gather comments and suggestions from users for improvement on things around our office, It is a form entry, a suggestion that was given is when users want to enter multiple suggestions they are having to re-enter the header section of the form (Basics of name and contact information) repeatedly, is there a code or work around where that will replicate for the user if they click the add new record after they enter the first entry? Are you storing this information in every row of the table? The way it should work is, when the...

draw geographic object on windows form.
I have some lines that are described by geographic coordinates (x1,y1) to (x2,y2) in UTM coordinate. What I'm trying to do is draw these lines onto a windows form to visualize what they look like. I can draw lines onto the form using the code below. my question is how do I convert my UTM coordinates to a form that can be drawn on the screen? Bitmap DrawArea; DrawArea = new Bitmap(pictureBox1.Size.Width, pictureBox1.Size.Height); pictureBox1.Image = DrawArea; Graphics g; g = Graphics.FromImage(DrawArea); Pen mypen = new Pen(Color.Black); g.DrawLine(mypen, 0, 0, 20, 6...

dynamic menu
Does anybody have any sample on how to build menu dinamically using xml files? Dan has some on his site. http://www.xmlforasp.net/search.aspx?searchText=menu This one is useful. http://www.xmlforasp.net/codeSection.aspx?csID=20 Thanks. Mark PM - System.Xml -- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm. "cribeiro" <cribeiro@lexxa.com.br> wrote in message news:OclagBccDHA.652@tk2msftngp13.phx.gbl... > Does anybody have...