Search Results

Search found 2806 results on 113 pages for 'winforms'.

Page 42/113 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Localize node texts in treeview using resource files

    - by Obalix
    For a project I need a tree view that allows the user to select a module, which then is displayed in a content area. The project relies heavily on localization and this is provided by the resource files. Now I discovered today, that the text that are assigned to preset tree view nodes are not contained in the resource files. So the question is whether there is a way of doing this, short of mapping the elemenst in code. I.e. assigning a name to the node, running over all nodes and pulling the resources from the resouce manager based on the node name. This is what I am currently doing, however, it just doesn't "feel" right: private void TranslateNodes(TreeNodeCollection treeNodeCollection) { var rm = Resources.ResourceManager; foreach (TreeNode node in treeNodeCollection) { node.Text = rm.GetString(node.Name + "_Text"); this.TranslateNodes(node.Nodes); } } Thanks!

    Read the article

  • how to display formatted text but have the actual text

    - by Behrooz
    hello I have my own textbox witch inherits System.Windows.Forms.TextBox I am trying to display texts like 5000000 formatted == 5,000,000 but the problem is that Control.Text should return 5000000 but it should display 5,000,000. I know it is WTF, but i really need it and i couldn't Google a lot because my native language is not English(and anyone can get it from my grammar and Im sorry for that).

    Read the article

  • Adding scrollbars to UserControl

    - by Bevin
    I am trying to add vertical and horizontal scrollbars to my UserControl with the HorizontalScroll and VerticalScroll properties, but I am having extreme issues. My problem arises when I drag or manipulate the scroll box on the bar. When I let it go, it simply jumps back to the start position! I know of the AutoScroll property, but I do not want to use it since I want to be able to control every aspect of my scrollbars, and I don't want it to be done automatically. Also, according to the documentation, AutoScroll is for "[enabling] the user to scroll to any controls placed outside of its visible boundaries" which isn't what I want. I just want scrollbars. ...aaand I suppose I could add VScrollBar and HScrollBar to the control, but why should I do this when the scroll functionality already exists? Seems like a waste to me.

    Read the article

  • .NET Form_load priority

    - by mtranda
    So, the problem is such as this: I have a method that does stuff and updates a progress bar. If I call the method after the form is fully loaded (i.e.: by assigning it to a button on the form) everything works fine. The problem is that I need the method to start working as soon as the form loads, by itself, so I would place it in the Form_Load method. The problem is that even though I call Application.DoEvents() right before calling that method from within Form_Load, the form doesn't show up until the method has completed everything. As I said, if I let the form load first and call the method from another UI element for instance, everything works fine. Thanks in advance.

    Read the article

  • WinForm Text Control that displays current character/character limit

    - by Refracted Paladin
    I need a way to display, like you see in some web apps, the current characters/character limit for a Text Control(i.e. 3/500). I usually see this as a label residing directly above or below the Text Control. How is this 'normally' accomplished? Should I override my Text Control somehow? Do I just manually add labels by every Text Control and 'bind' them to properties of the Text Control? Do I need to create a composite control that has the Text Control & Label Controls together to accomplish what I need? Any direction or help will be greatly appreciated.

    Read the article

  • C# Messagebox With ComboBox

    - by Goober
    How can I produce a messagebox in a C# Win Forms application that displays a combobox with a series of values to select as well as the usual "Ok" button? I would like to be able to trigger this on calling the MessageBox.Show() method. I am assuming some sort of override will be necessary, but I haven't seen any pre-existing examples for this.

    Read the article

  • Inherited properties aren't bound during databinding

    - by Josh
    I have two interfaces, IAuditable and ITransaction. public interface IAuditable{ DateTime CreatedOn { get; } string CreatedBy { get; } } public interface ITransaction : IAuditable { double Amount{ get; } } And a class that implements ITransaction, call Transaction. public class Transaction : ITransaction{ public DateTime CreatedOn { get { return DateTime.Now; } } public string CreatedBy { get { return "aspnet"; } } public doubl Amount { get { return 0; } } } When I bind a list of ITransactions to a datagrid and use auto create columns, only the Amount gets bound. The CreatedBy and CreatedOn are not seen. Is there a way I can get these values visible during databinding?

    Read the article

  • C# Spell checker Problem

    - by reggie
    I've incorporated spell check into my win forms C# project. This is my code. public void CheckSpelling() { try { // declare local variables to track error count // and information int SpellingErrors = 0; string ErrorCountMessage = string.Empty; // create an instance of a word application Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application(); // hide the MS Word document during the spellcheck //WordApp.WindowState = WdWindowState.wdWindowStateMinimize; // check for zero length content in text area if (this.Text.Length > 0) { WordApp.Visible = false; // create an instance of a word document _Document WordDoc = WordApp.Documents.Add(ref emptyItem, ref emptyItem, ref emptyItem, ref oFalse); // load the content written into the word doc WordDoc.Words.First.InsertBefore(this.Text); // collect errors form new temporary document set to contain // the content of this control Microsoft.Office.Interop.Word.ProofreadingErrors docErrors = WordDoc.SpellingErrors; SpellingErrors = docErrors.Count; // execute spell check; assumes no custom dictionaries WordDoc.CheckSpelling(ref oNothing, ref oIgnoreUpperCase, ref oAlwaysSuggest, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing); // format a string to contain a report of the errors detected ErrorCountMessage = "Spell check complete; errors detected: " + SpellingErrors; // return corrected text to control's text area object first = 0; object last = WordDoc.Characters.Count - 1; this.Text = WordDoc.Range(ref first, ref last).Text; } else { // if nothing was typed into the control, abort and inform user ErrorCountMessage = "Unable to spell check an empty text box."; } WordApp.Quit(ref oFalse, ref emptyItem, ref emptyItem); System.Runtime.InteropServices.Marshal.ReleaseComObject(WordApp); // return report on errors corrected // - could either display from the control or change this to // - return a string which the caller could use as desired. // MessageBox.Show(ErrorCountMessage, "Finished Spelling Check"); } catch (Exception e) { MessageBox.Show(e.ToString()); } } The spell checker works well, the only problem is when I try to move the spell checker the main form blurs up for some reason. Also when I close the spell checker the main form is back to normal. It seems like it is opening up Microsoft word then hiding the window, only allowing the spell checker to be seen. Please help.

    Read the article

  • Iterating through controls on a Windows Form

    - by icemanind
    I seem to have some weird issue going on that I am sure will turn out to be a simple thing. I have a Windows Form and on the form I have 1 panel called MainPanel and inside MainPanel, I got another panel with a button inside and a label that is inside MainPanel, but not in the second panel. 2 controls. What I am trying to do is copy all the controls inside MainPanel over to another panel object. I am using the following C# code to do this: GUIPanel gp = new GUIPanel(); foreach (System.Windows.Forms.Control ctrl in gp.Controls["MainPanel"].Controls) { m_OptionsControl.Controls.Add(ctrl); } When I run this code, it copies over the panel with the button, but not the label. What's even more odd is when I set a breakpoint and run it through the debugger, and I type "?gp.Controls["MainPanel"].Controls.Count" in the immediate window, it returns 2, just like it should. However, when stepping through the code, it only executes the foreach loop once. What am I missing here?

    Read the article

  • Architecture Guidance Needed?

    - by vijay
    We are about to automate number of process for our reporting team. (The reports are like daily reports, weekly reports, monthly reports, etc..) Mostly the process is like pulling some data from the oracle and then fill them in particular excel template files. Each reports and so their templates are different from each other. Except the excel file manipulation, there are hardly any business logic behind these. Client wanted an integrated tool and all the automated processes are placed as menus/submenus. Right now roughly there are around 30 process waiting to be automated. And we are expecting more new reports in the next quarter. I am nowhere to near having any practical experience when comes to architecuring. Already i have been maintaining two or three systems(they are more than 4yrs old.) for this prestegious client.The possiblity of the above mentioned tool will be manintained for another 3 yrs is very likely. From my past experience i've been through the pain of implmenting change requests to the rigd & undocumented code base resulting in the break down of the system and then eventually myself. So My main and top most concern is the maintainablity. When i was searching for these i came across this link, Smart Clients Using CAB and SCSF is the above link appropriate for my requirement? Also Should i place each automated processes in separate forms under a single project, or place them in separate projects under a single solution.. Please correct me if have missed any other important information. Thx.

    Read the article

  • ListView control rendering issue with Groups, CheckBoxes and View mode SmallIcon

    - by volody
    Microsoft MSDN site has next remark: "Any groups assigned to a ListView control appear whenever the ListView.View property is set to a value other than View.List." My problem is that i like to have View set to SmallIcon. In this mode ListView control is shifted left, and CheckBoxes are covered by left edge How to solve this issue, or at least how is possible to shift rendering of control to the right. My OS is Windows XP Service Pack 3. It looks like that ListView items with Groups and CheckBoxes shows correctly only when View set to Details.

    Read the article

  • Prevent deferred creation of controls.

    - by Scott Chamberlain
    Here is a test framework to show what I am doing, just create a new project add a tabbed control, on tab 1 put a button on tab 2 put a check box (default names) and paste this code for its code public partial class Form1 : Form { private List<bool> boolList = new List<bool>(); BindingSource bs = new BindingSource(); public Form1() { InitializeComponent(); boolList.Add(false); bs.DataSource = boolList; checkBox1.DataBindings.Add("Checked", bs, ""); } bool updating = false; private void button1_Click(object sender, EventArgs e) { updating = true; boolList[0] = true; bs.ResetBindings(false); Application.DoEvents(); updating = false; } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (!updating) MessageBox.Show("CheckChanged fired outside of updating"); } } The issue is if you run the program and look at tab 2 then press the button on tab 1 the program works as expected, however if you press the button on tab 1 then look at tab 2 the event for the checkbox will not fire untill you look at tab 2. The reason for this is the controll on tab 2 is not in the "created" state, so its binding to change the checkbox from unchecked to checked does not happen until after the control has been "Created". checkbox1.CreateControl() does not do anything because according to MSDN CreateControl does not create a control handle if the control's Visible property is false. You can either call the CreateHandle method or access the Handle property to create the control's handle regardless of the control's visibility, but in this case, no window handles are created for the control's children. I tried getting the value of Handle(there is no CreateHandle for Button) but still the same result. Any suggestions other than have the program quickly flash all of my tabs that have data-bound check boxes when it first loads?

    Read the article

  • How to Detect Right Click on the Taskbar

    - by Zay
    I've got a Windows Forms application in C# that starts off with a loading dialog. As expected, a button for the app shows up in the Windows taskbar. I would like to detect right-clicks that might be done to that button. Ultimately, I hope to disable the right-click or simply have the loading dialog regain focus. I've seen that some people use custom libraries and packages (interop, for example) to achieve some Win32 functionality, but I'd personally like to avoid this. Is it impossible to do without such libraries/packages?

    Read the article

  • WebBrowser created dynamically doesn't work

    - by Maciej
    I'd like to create WebBrowser control programically in my code and then read page content. I think I'm doing the same thing as designer does but control dynamically created doesn't work (DocumentText return empty string) What I'm doing wrong ?? WebBrowser browser = new WebBrowser { Name = "myBrowser"}; browser.Navigate("www.google.com"); Console.WriteLine(browser.DocumentText);

    Read the article

  • Unable to use Client Application Services with custom MembershipProvider.

    - by Shimmy
    Hi, I have a Windows-Forms Application that I configured to use with an ASP.NET Service that is an Authentication service using a custom MembershipProvider. When I call Membership.CreateUser in the Windows Application a NotSupportedException is thrown telling: "Specified method is not supported.". I tried creating a web page in the website and test the MembershipProvider, everything works just fine when woeking from within the website. Any ideas or link for how to use custom (not SqlMembershipProvider) MembershipProvider will be really appreciated! Edit: The method ValidateUser does work. The overriden CreateUser doesn't work I tried Override Sub CreateUser(.......) As MembershipUser Return New User() End Sub But I still get the same excetption as before.

    Read the article

  • Form gets disposed somehow

    - by mnn
    I have a client-server application, in which I use classic Sockets and threads for receiving/sending data and listening for clients. The application works fine, but after some random time I get the ObjectDisposedException: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'MainForm'. at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous) at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args) at System.Windows.Forms.Control.Invoke(Delegate method) That code is called from client Socket thread and I use Invoke() method to run the code on UI thread. I'm sure that I don't manually dispose the form nor using Close() (form is closed by user clicking Close button), so I don't know what could cause its disposing.

    Read the article

  • Control.IsAccessible

    - by Gerhard
    I need to check if a c# WinForm Window (FORM Class) has been initialized and waiting for user events. But I could not find out how to manage that. Therefore I had the idea to set the Control.IsAccessible Flag of the Form to true, within the OnLoad Event of the Windows Form. My question is now, what is the Control.IsAccessible Flag origin intended for? Or is there an other solution to check if the Winform is initialized. Thanks for your help

    Read the article

  • Cancel Leave Event when closing

    - by DiegoMaK
    I have got a textbox on a form with a method being called from the txPredio_Leave event. My problem is that is the user has focus on the textbox and then close the form by clicking the little X close icon in the top corner or by calling this.ActiveMdiChild.Close(); or by calling private void mnucerrarTodas_Click(object sender, EventArgs e) { foreach (Form form in this.MdiChildren) { form.Close(); } } The txPredio leave execute the method.. then i need doesn't excute this method when the form is closing. i have think that one solution could be ask in leave event if form is closing private void txPredio_Leave(object sender, EventArgs e) { if(!form is closing)//pseudo code Check_Load_Predio(); } or other solution could be private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { //code for cancel the txPredio_Leave event } Solution Here Doesn´t work for me. Then I need one solution for my problem. Thanks in advance

    Read the article

  • How to store user settings(username,password) in a windows application for the current login user

    - by amexn
    Now my team working in a project using windows application(c#). The application have a option for saving the username & password in the client machine for the current login user.so the user can start the application without entering username & password.I didn't have any knowledge in the windows application.Please check the snapshot of my requirement. Please suggest good example/reference.

    Read the article

  • What's the simplest way to ask for user input through Modal in Win Form

    - by Refracted Paladin
    What is the simplest way to implement a Modal(popup) MessageBox that allows a custom value to be entered and returned. In my case, a String. Maybe I am over thinking this but I figured I'd ask. I plan to just create a new Form. Add a label, a textbox, two buttons. Assign the textbox to a property and from my main form call a ShowDialog() on it. Will I be able to still access the property that way or should I somehow return the value? Is this a decent way of doing this?

    Read the article

  • Bound checkbox does not update its datasource.

    - by Scott Chamberlain
    I have a checkbox who's checked value is bound to a binding source which is bound to a boolean data table column. When I click my save button to push my changes in my data table to my sql server the value in the data table is never changed. Designer code. this.cbxKeepWebInfinityChanges = new System.Windows.Forms.CheckBox(); this.preProductionBindingSource = new System.Windows.Forms.BindingSource(); // // cbxKeepWebInfinityChanges // this.cbxKeepWebInfinityChanges.AutoSize = true; this.cbxKeepWebInfinityChanges.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.preProductionBindingSource, "WEBINFINTY_CHANGES", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); this.cbxKeepWebInfinityChanges.Location = new System.Drawing.Point(6, 98); this.cbxKeepWebInfinityChanges.Name = "cbxKeepWebInfinityChanges"; this.cbxKeepWebInfinityChanges.Size = new System.Drawing.Size(152, 17); this.cbxKeepWebInfinityChanges.TabIndex = 30; this.cbxKeepWebInfinityChanges.Text = "Keep WebInfinity Changes"; this.cbxKeepWebInfinityChanges.UseVisualStyleBackColor = true; this.cbxKeepWebInfinityChanges.CheckedChanged += new System.EventHandler(this.CauseApplyChangesActivation); // // preProductionBindingSource // this.preProductionBindingSource.AllowNew = false; this.preProductionBindingSource.DataMember = "PreProduction"; this.preProductionBindingSource.DataSource = this.salesLogix; Save Code //the comments are the debugger values before the call in going from checked when loaded to unchecked when saved. private void btnApplyChanges_Click(object sender, EventArgs e) { (...) // non related saving logic for other controls preProductionBindingSource.EndEdit(); // checked = false, databinding = true, datatable = true preProductionTableAdapter.Update(salesLogix.PreProduction); // checked = false, databinding = true, datatable = true } After the saving code the box rechecks itself. The same things happens when going from unchecked to checked. does not save the change and reverts to the old value. Other items I have bound to the same data-binding source (I have two combo boxes) are updating correctly.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >