Search Results

Search found 6055 results on 243 pages for 'forms'.

Page 91/243 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • Databinding in windows forms on an object graph with possible null properties?

    - by Fredrik
    If I have an object graph like this: class Company { public Address MainAddress {...} } class Address { public string City { ... } } Company c = new Company(); c.MainAddress = new Address(); c.MainAddress.City = "Stockholm"; and databind to a control using: textBox1.DataBinding.Add( "Text", c, "MainAddress.City" ); Everything is fine, but If I bind to: Company c2 = new Company(); c2 using the same syntax it crashes since the MainAddress property is null. I wonder if there is a custom Binding class that can set up listeners for all the possible paths here and bind to the actual object dynamically when/if I sometime later in the application set the MainAddress property.

    Read the article

  • What is the best method for implementing mouse wheel activity in Delph1 VCL forms?

    - by Brian Frost
    As a long time user of Delphi 7, I've rolled my own mouse wheel handling in a few controls but lately I've noticed that some recent applications only need the mouse cursor to be placed over a control (e.g a list box or tree view) for the mouse wheel activity to cause that control to scroll. This feels nice (as opposed to having to click focus a control before it responds to the wheel. Now I've moved to Delphi 2010 I'm wondering what is the 'correct' behaviour? And what can I use in Delphi that avoids me having to bodge this with my own solutions now? Thanks.

    Read the article

  • How to load images and fragments dynamically in LiveCycle Designer forms?

    - by John
    Hi there. I've created a couple of shared templates (.xdp) which will be shared among several clients. Obviously, each client has their own logo and I'd like to set the logo upon form generation. I've managed to change the logo dynamically although I'm not sure if my approach is good. In the xml datasource I've got this element: <ClientID>SomeNumber</ClientId> In the form itself I set the image href with this javascript code: SomeHiddenTextField::calculate HeaderLogo.value.image.href = $record.ClientID + "_logo.jpg"; I've got the logos stored on the server in the same folder as the shared templates. Is this an alright approach to load logos dynamically? I've been trying to achieve the same dynamic behaviour with each client's footer fragment, but I have been unable to figure out how to load these on demand. I could make each footer fragment in to an image but I'd like to avoid it if possible.

    Read the article

  • Why does the '#weight' property sometimes not have any effect in Drupal forms?

    - by Adrian
    Hello, I'm trying to create a node form for a custom type. I have organic groups and taxonomy both enabled, but want their elements to come out in a non-standard order. So I've implemented hook_form_alter and set the #weight property of the og_nodeapi subarray to -1000, but it still goes after taxonomy and menu. I even tried changing the subarray to a fieldset (to force it to actually be rendered), but no dice. I also tried setting $form['taxonomy']['#weight'] = 1000 (I have two vocabs so it's already being rendered as a fieldset) but that didn't work either. I set the weight of my module very high and confirmed in the system table that it is indeed the highest module on the site - so I'm all out of ideas. Any suggestions? Update: While I'm not exactly sure how, I did manage to get the taxonomy fieldset to sink below everything else, but now I have a related problem that's hopefully more manageable to understand. Within the taxonomy fieldset, I have two items (a tags and a multi-select), and I wanted to add some instructions in hook_form_alter as follows: $form['taxonomy']['instructions'] = array( '#value' => "These are the instructions", '#weight' => -1, ); You guessed it, this appears after the terms inserted by the taxonomy module. However, if I change this to a fieldset: $form['taxonomy']['instructions'] = array( '#type' => 'fieldset', // <-- here '#title' => 'Instructions', // <-- and here for good measure '#value' => "These are the instructions", '#weight' => -1, ); then it magically floats to the top as I'd intended. I also tried textarea (this also worked) and explicitly saying markup (this did not). So basically, changing the type from "markup" (the default IIRC) to "fieldset" has the effect of no longer ignoring its weight.

    Read the article

  • Small, editable table of strings. Which Forms control do I want? (.NET)

    - by I. J. Kennedy
    I have a small array of structs, each struct has three fields, all strings. I want to display these structs in a grid, let the user edit the strings a la Excel, and then retrieve the edited strings of course. Which WinForms control is best for this? Tried a DataGridView but setting the DataSource to the array of structs doesn't seem to work. There are myriad controls with similar names but I can't figure out what does what. All the examples I've found are geared toward using a database as the data source--I just have a simple array.

    Read the article

  • Is ther a Designer for MFC in Visual Studio like for windows forms in .NET?

    - by claws
    Hello, I'm a .NET programmer. I've never developed anything in MFC. Currently I had to write a C++ application (console) for some image processing task. I finished writing it. But the point is I need to design GUI also for this. Well, there won't be anything complex. Just a window with few Buttons, RadioButtons, Check Boxes, PicturesBox & few sliders. thats it. I'm using VS 2008 and was expecting a .NET style form designer. Just to test, I created a MFC project (with all default configuration) and these files were created by default: ChildFrm.cpp MainFrm.cpp mfc.cpp mfcDoc.cpp mfcView.cpp stdafx.cpp Now, I'm unable to find a Designer. There is no View Designer. I've opened all the above *.cpp and in the code editor right clicked to see "Designer View". ToolBox is just empty because I'm in code editor mode. When I built the project. This is the window I get. How to open a designer?

    Read the article

  • How to implement async pattern in windows forms application?

    - by Alkersan
    I'm using an MVC pattern in winforms application. I need to call remote service asynchronously. So On some event in View I invoke corresponding Presenter method. In Presenter I call BeginInvoke method of service. But to View must be updated only in Main Thread. I could actualy point CallBack to some function in View, and update it`s controls state, but this conflicts with MVP pattern - View must not be responsible for data it carries. This callback function must be in Presenter. But how then invoke View in Main Thread?

    Read the article

  • How To Bind ComboBox With ListItems in windows Forms?

    - by hatem gamil
    hi all i want to make a 2 comboBoxes ,the first one shows Hours and the Second Shows minutes but i cant do so in windows application as i have working as a web dev for a while and i forgot so i want to declare listItems then bind it to combo box i want to make it as a custom control so i want some help to tell me how to do that i am using VS 2008 thnxx

    Read the article

  • No event is firing when placing a custom data bound control in DataRepeater control in Windows forms

    - by Remo
    Hi, Custom events in a custom data bound control are not firing in DataRepeater control. When I debug it I found that the DataRepeater Control recreates the control using Activator.CreateInstance and Copies the Properties and Events. In my case copying events doesn't copy the custom events that I hooked in. For example public class MyClass : Control { public event EventHandler MyEvent; protected virtual void OnMyEvent() { if(this.MyEvent != null) { this.MyEvent(this,EventArgs.Empty); } } private int selectedIndex= -1; public int SelectedIndex { get { return this.selectedIndex; } set { if(this.selectedIndex != value) { this.selectedIndex = value; this.OnMyEvent(); } } } // // DataBinding stuff goes here // } public Form1() { InitialiseComponent(); ArrayList list = new ArrayList(); list.Add("one"); this.dataRepeater1.DataSource = list; // One Repeater MyClass test = new Myclass(); test.DataSource = GetDataTable(); this.dataRepeater1.ItemTemplate.Controls.Add(test); test.MyEvent +=new EventHandler(test_MyEvent); } // This Event should fire when selected index of Datatable is changed and is firing when placed directly in the form and not firing when place in DataRepeater control/////////////////////// private void test_MyEvent(object sender, EventArgss e) { // This event is not fired/////////////////////// } private DataTable GetDataTable() { ..// Create a data Table and return } Any help Appreciated. Thanks,

    Read the article

  • How can I use EF in windows forms to insert new data ?

    - by Al0NE
    Hi Maybe it's simple question, but it's my first time with EF + win app so ... I'm building win app with EF by adding edmx as data source then drag and drop the tables to get navigator and binding source .. when I press the add button in the navigator it allows me to enter new data but when I save the context I get NULL data for all fields except the auto increment field ( the ID field ).... What should I do to save many entries ...? DO I have to loop over all the entities in the binding source and add them to the context ?? Thanx in advance Update: I forgot to say that when i use data grid view it adds the items correctly but with "Details" it didn't ..

    Read the article

  • MS Access 07 - Q re lookup column vs many-to-many; Q re checkboxes in many-to-many forms

    - by TBinLondon
    Hello, I'm creating a database with Access. This is just a test database, similar to my requirements, so I can get my skills up before creating one for work. I've created a database for a fictional school as this is a good playground and rich data (many students have many subjects have many teachers, etc). Question 1 What is the difference, if any, between using a Lookup column and a many-to-many associate table? Example: I have Tables 'Teacher' and 'Subject'. Many teachers have many subjects. I can, and have, created a table 'Teacher_Subject' and run queries with this. I have then created a lookup column in teachers table with data from subjects. The lookup column seems to take the place of the teacher_subject table. (though the data on relationships is obviously duplicated between lookup table and teacher_subject and may vary). Which one is the 'better' option? Is there a snag with using lookup tables? (I realize that this is a very 'general' question. Links to other resources and answers saying 'that depends...' are appreciated) Question 2 What attracts me to lookup tables is the following: When creating a form for entering subjects for teachers, with lookup I can simply create checkboxes and click a subject for a teacher 'on' or 'off'. Each click on/off creates/removes a record in the lookup column (which replaces teacher_subject). If I use a form from a query from teacher subject with teacher as main form and subject as subform I run into this problem: In the subform I can either select each subject that teacher has in a bombo box, i.e. click, scroll down, select, go to next row, click, scroll down, etc. (takes too long) OR I can create a list box listing all available subjects in each row but allowing me to select only one. (takes up too much space). Is it possible to have a click on/off list box for teacher_subject, creating/removing a record there with each click? Note - I know zero SQL or VB. If the correct answer is "you need to know SQL for this" then that's cool. I just need to know. Thanks!

    Read the article

  • How to define default values optional fields in play framework forms?

    - by natalinobusa
    I am implementing a web api using the scala 2.0.2 play framework. I would like to extract and validate a number of get parameters. And for this I am using a play "form" which allows me to define optional fields. Problem: For those optional fields, I need to define a default value if the parameter is not passed. The code is intended to parse correctly these three use cases: /test?top=abc (error, abc is not an integer) /test?top=123 (valid, top is 123) /test (valid, top is 42 (default value)) I have come up with the following code: def test = Action { implicit request => case class CData(top:Int) val p = Form( mapping( "top" -> optional(number) )((top) => CData($top.getOrElse(42))) ((cdata:CData) => Some(Some(cdata.top))) ).bindFromRequest() Ok("all done.") } The code works, but it's definitely not elegant. There is a lot of boiler plate going on just to set up a default value for a missing request parameter. Can anyone suggest a cleaner and more coincise solution?

    Read the article

  • In forms application, is there any Alternative to MsgBox?

    - by GuruC
    I like how MsgBox stops all further processing until it's clicked but I don't like how it pops that little msgbox in the middle of the screen, which I then have bring to the front if there is a window covering it. Is there a way to do something like a msgbox but keep it on my Form (which is always in view) so I can go ahead and click a button on the form instead of having to bring the little msgbox window on top of windows that may be covering it. I use the msgbox to inform me that a certain situation has happened, which I manually fix and when I'm done I click the MsgBox to continue processing. It'd be nice to have this button right on the form.

    Read the article

  • Does SharePoint 2010 Forms Authentication support 'Open with Explorer?

    - by Leo Wong
    I have successfully configured FBA in SharePoint 2010 with client integration enabled. I can edit the Word document with Office Word. The ‘Open with Explorer’ tool bar is enabled, but I get the error: \siteurl\DavWWWRoot\document is not accessible. you might not have permission to use this network resource. Is the 'Open with Explorer' option available with FBA? If yes, what are the missing settings?

    Read the article

  • How do I avoid nesting forms when offering inline editing of lists with checkboxes for mass updates.

    - by adam
    A lot of sites offer the ability to edit lists of items inline as well as allowing multiple items to be selected via checkboxes and have an action performed all at once e.g. delete, mark as spam etc. But how do you implement this without violating html rules. I need one form for the checkboxes with individual submit_tags for the mass actions. But after a user clicks on an item in the list, another form via Ajax will be inserted within the checkbox form. How do I avoid doing this? I'm using rails and jQuery.

    Read the article

  • Regular Expression to recognise truncated forms of search string?

    - by Moonshield
    I'm trying to formulate a regular expression which will recognise the search term truncated by any number of characters from the right. For example, if the search term is "pickle", the regex should recognise "pi", "pick" but not "pickaxe". Initially I came up with the following: p(i(c(k(l(e)?)?)?)?)? That works perfectly, but seems a crude way of doing it. Is there a better way of doing this? I had a look around for something similar to what I want, but I'm not entirely sure what to search for.

    Read the article

  • How can I tell when the Text of a System.Windows.Forms.GroupBox wraps to the next line?

    - by fre0n
    I'm creating a GroupBox at runtime and setting its Text property. Usually, the text is only on one line, but sometimes it wraps. The problem is that the controls contained in the GroupBox cover up the GroupBox's text. What I'd like to do is determine if and when the text wraps. Specifically, I'd like to determine how much extra height the wrapped text takes up as compared to a single line. That way, I can reposition the GroupBox's controls and adjust its height. Initially, I thought I'd do this by calling the GroupBox's CreateGraphics() method, and using the Graphics to measure the string. Something like this: private void SetGroupBoxText(GroupBox grp, string text) { const int somePadding = 10; Graphics g = grp.CreateGraphics(); SizeF textSize = g.MeasureString(text, grp.Font); if (textSize.Width > (grp.Width - somePadding)) { // Adjust height, etc. } } The problem is that the size generated by g.MeasureString(text, grp.Font) doesn't seem to be accurate. I determined that it wasn't accurate by putting enough of a single character to cause a wrap, then measuring the resulting string. For example, it took 86 pipes (|) to until a wrap happened. When I measured that string, its width was ~253. And it took 16 capital W's to force a wrap - its string had a width of ~164. These were the two extremes that I tested. My GroupBox's width was 189. (a's took 29 and had a width of ~180, O's took 22 and had a width of ~189) Does anyone have any ideas? (hacks, WinAPI, etc. are welcome solutions)

    Read the article

  • Is there a Designer for MFC in Visual Studio like for windows forms in .NET?

    - by claws
    I'm a .NET programmer. I've never developed anything in MFC. Currently I had to write a C++ application (console) for some image processing task. I finished writing it. But the point is I need to design GUI also for this. Well, there won't be anything complex. Just a window with few Buttons, RadioButtons, Check Boxes, PicturesBox & few sliders. thats it. I'm using VS 2008 and was expecting a .NET style form designer. Just to test, I created a MFC project (with all default configuration) and these files were created by default: ChildFrm.cpp MainFrm.cpp mfc.cpp mfcDoc.cpp mfcView.cpp stdafx.cpp Now, I'm unable to find a Designer. There is no View Designer. I've opened all the above *.cpp and in the code editor right clicked to see "Designer View". ToolBox is just empty because I'm in code editor mode. When I built the project. This is the window I get. How to open a designer?

    Read the article

  • How to anti-alias the fonts in visual studio in windows forms application?

    - by user1781077
    i want my font to be anti aliased like this so that it looks more professionalenter link description heredoes any one know the code to anti alias the fonts so that the project looks more professional.tell me the code and where to insert it in the project.As of now the fonts looks jaggy the programming language is visual C# 4.0 .net and IDE is VS 2010 for example this is a label1 what do I need to insert to anti alias this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(189, 187); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(31, 13); this.label1.TabIndex = 0; this.label1.Text = "from";

    Read the article

  • How can I use multithreading in a Windows Forms application to update a progress bar?

    - by Steve Syfuhs
    There are two objects. The Windows Form with a button and a progress bar, and another object that handles an algorithm. In the algorithm object there is an event, and a property. The event is ProgressChanged, and the property is Progress (which is an int). In the calling window, the button starts off a set of steps in the algorithm object. As each step (or substeps) occurs, the ProgressChanged event fires, and in the window there is an event handler that essentially increments the progress bar relative to the Progress property. The problem I am running into is that because the algorithm has a possibility (and high liklihood) of running a relatively long time, I need to move it into it's own background thread and push the event back up to the window. My issue is that I'm not completely sure what I'm doing when it comes to multi-threading. I've looked at Control.Invoke and I'm a little lost. Can someone point me in the right direction?

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >