Search Results

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

Page 61/113 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • UserControl/TreeView Problem....Not getting result during runtime..

    - by Samiul
    Hi all, My problem is, I'm using a TreeView in a UserControl. While debugging, I can see the results are adding in the TreeView but it's not happening when I'm using that UserControl onto my MainForm. The UserControl containing the TreeView remains blank during runtime of the main application. I've also referenced the UserControl project with my Main project. Here I'm giving my code for helping me out. Thanks in advance. Code: In the UserControl class: public override void Refresh() { PopulateTreeView(); } private void PopulateTreeView() { TreeNodeCollection treeNodeCollection; treeNodeCollection = CreateParentNode("My Information"); CreateChildNode(treeNodeCollection, "Name"); CreateChildNode(treeNodeCollection, "Address"); this.Update(); myTreeView.ExpandAll(); } private TreeNodeCollection CreateParentNode(string parentNode) { TreeNode treeNode = new TreeNode(parentNode); myTreeView.Nodes.Add(treeNode); return treeNode.Nodes; } private void CreateChildNode(TreeNodeCollection nodeCollection, string itemName) { TreeNode treeNode = new TreeNode(itemName); nodeCollection.Add(treeNode); } In my MainForm: private void button1_Click(object sender, EventArgs e) { UserControl userControl = new UserControl(); userControl.Refresh(); }

    Read the article

  • window form: Adding Emoticons

    - by Emaad Ali
    Hi, i am trying to develop a window form using c# with asp.net 3.5 framework. in that form i want to insert emoticons as we found in yahoo, hotmail etc messenger. can anyone tell me how i can implement that thing as it is done in messenger. please help me.

    Read the article

  • VS2010 is removing code from designer without warning - causing issues

    - by schmoopy
    I have a WinForm with a pretty complex layout (has lots of controls, panels, etc.) Whenever i open the form the file is automatically checked out from source control and it removes anything in the designer file that refereces my menustrip or statusstrip ie: the following get removed (w/o warning) Me.MyMenuStip.SuspendLayout() Me.MyStatusStrip.SuspendLayout() Me.MyMenuStrip.ResumeLayout(False) Me.MyMenuStrip.PerformLayout() Me.MyStatusStrip.ResumeLayout(False) Me.MyStatusStrip.PerformLayout() The code still builds, but there are no Menu or Status items rendered. Any ideas on what i can do? I do not want to just remove/add the menustrip for instance cause i would loose all of my menu items (and there are a lot) Thanks in advance!

    Read the article

  • PropertyGrid - is it customizable?

    - by serhio
    I have a project in that we have to represent some graphic objects on a usercontrol in WYSIWYG. Also is required to edit each objects properties(Color, Location, etc). I hesitate between using PropertyGrid ('direct' properties edit) and custom forms on DoubleClick ('indirect' edit). The PropertyGrid is very well but should correspond a some criteria: Only selected properties are Displayed (by e.g. if I have TextRectangle want display only Text and Location); Property names should be customizable and internationalizable (by e.g. TextRectangle Text property should be named "Company Name" or "???????? ???????????"). Now about is it possible I think the answer could be Yes, but is it reasonable to use it if we have not a lot of time. What could be quicker implemented, custom forms or Property panel?

    Read the article

  • Custom Controls Properties - C# , Forms - :(

    - by user353600
    Hi I m adding custom control to my flowlayoutpanel , its a sort of forex data , refresh every second , so on each timer tick , i m adding a control , changing controls button text , then adding it to flowlayout panel , i m doing it at each 100ms timer tick , it takeing tooo much CPU , here is my custom Control . public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } private void UserControl1_Load(object sender, EventArgs e) { } public void displaydata(string name , string back3price , string back3 , string back2price , string back2 , string back1price , string back1 , string lay3price , string lay3 , string lay2price , string lay2 , string lay1price , string lay1 ) { lblrunnerName.Text = name.ToString(); btnback3.Text = back3.ToString() + "\n" + back3price.ToString(); btnback2.Text = back2.ToString() + "\n" + back2price.ToString(); btnback1.Text = back1.ToString() + "\n" + back1price.ToString(); btnlay1.Text = lay1.ToString() + "\n" + lay1price.ToString(); btnlay2.Text = lay2.ToString() + "\n" + lay2price.ToString(); btnlay3.Text = lay3.ToString() + "\n" + lay3price.ToString(); } and here is how i m adding control; private void timer1_Tick(object sender, EventArgs e) { localhost.marketData[] md; md = ser.getM1(); flowLayoutPanel1.Controls.Clear(); foreach (localhost.marketData item in md) { UserControl1 ur = new UserControl1(); ur.Name = item.runnerName + item.runnerID; ur.displaydata(item.runnerName, item.back3price, item.back3, item.back2price, item.back2, item.back1price, item.back1, item.lay3price, item.lay3, item.lay2price, item.lay2, item.lay1price, item.lay1); flowLayoutPanel1.SuspendLayout(); flowLayoutPanel1.Controls.Add(ur); flowLayoutPanel1.ResumeLayout(); } } now its happing on 10 times on each send , taking 60% of my Core2Duo cpu . is there any other way , i can just add contols first time , and then change the text of cutom controls buttons on runtime on each refresh or timer tick i m using c# .Net

    Read the article

  • Recommendations for C# controls that can be used to create a hierarchical list of prioritised items?

    - by Mendokusai
    I need to be able to display and edit a hierarchical list of tasks in a C# app. It can either be a Windows form app, or ASP.NET. Basically, I want similar behaviour to the way Microsoft Project handles tasks. The control would need to: 1) Maintain a list of items made up of several fields 2) Each item can have a number of children (at least 3 levels of nesting) 3) It needs to be very easy to change the parents/children of an item 4) It needs to be very easy to edit the fields (as fast as changing cells in Excel) 5) It needs to be very easy to reorder the items by dragging and dropping or cut and paste 6) If I can easily connect the control to a database, even better Anyone got any recommendations for controls for me to look at?

    Read the article

  • MainMenu with Images

    - by j-t-s
    I have a MainMenu in my app and I would like to have little icons relevant to the Item in each menu. But the MainMenu control does not support this. I would use the MenuStrip control, though that is a pretty ugly option in my opinion. Does anybody have any suggestions? Are there any free/open source alt's out there, or would it be easy/possible to implement that feature into the existing MainMenu control?

    Read the article

  • Can I get the item type from a BindingSource?

    - by Preston
    I would like to get the Type of item that a BindingSource is hooked up to or configured for. The BindingSource.DataSource property can be set to an object, list, or type. If it is a Type, it obviously does not have an bound item yet, but I would still like to get the Type. For a List, I need the item Type, not the list type. There is a method BindingSource.GetItemProperties, that accomplishes most of what I need. It gets the PropertyDescriptors for the Type, list item, or object specified by the DataSource and DataMember. The reason I ask, is that I have some components that I would like to re-use, but they are currently setup to work off of an item Type. The Type is mainly used to get PropertyInfos and then build a UI, but PropertyInfo and PropertyDescriptor is not exactly the same, so it is not immediately apparent that they can be reworked to use a PropertyDescriptor collection instead. Then there is cascading refactoring of everything already using these components and that adds up to a lot of work that I would rather not do. I've looked through the API docs for for a good way to do this, but so far I have not had any luck. Am I missing something or is this just something I can not or should not be doing?

    Read the article

  • Prevent painting of .NET form while form is loading?

    - by dvcolgan
    Is there a way to turn off all visual updates to a .NET form while I am manipulating it? When my program first loads, for example, I set the tab control to the tab that was last open. The user can see the program switching tabs. I have looked into SuspendLayout and ResumeLayout, but either I don't understand what they are doing, or I am not using them correctly, because they don't seem to have any effect. Someone told me that there used to be a way to turn off paint events in VB 6. Does this still exist in .NET?

    Read the article

  • In Winform I need ASP.NET like membership and roles stuff. But Roles doesn't work

    - by user512602
    Hi, following http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm I set up the membership & roles providers in app.config and try use it in code. Authentication works well, bur roles always returns empty roles array for connected user. This part works: If Membership.ValidateUser(userName, password) Then ' Set the current application principal information to a known user Dim identity As GenericIdentity Dim principal As RolePrincipal Dim user As MembershipUser user = Membership.GetUser(userName) identity = New GenericIdentity(user.UserName) principal = New RolePrincipal(identity) Threading.Thread.CurrentPrincipal = principal This one doesn't: If principal.IsInRole("Club") Then LoggedInUserRole = "Club" Return True Exit Function End If No error is thrown though. Similarly, if I try to add a user to a known, existing role, an exception is thrown : If Not Roles.IsUserInRole(userName, "club") Then Roles.AddUserToRole(userName, "club") End If Exception msg is: Cannot find role '' (I mean the role name isn't given back in exception.) Any clue? Please do not tell me to use Windows Client Administration within project services, I need my own SQL DB connection + the client app services is a bloated dfeature, bug prone.

    Read the article

  • Properties are making trouble

    - by DhavalR
    In my application I have added a Properties.cs file which contains properties that I am would use through out the application. I am getting NullReferenceException = Object reference not set to an instance of an object. Here is the code for Properties.cs public class Properties { private static string type1; public static string Type1 { get { return type1; } set { type1= value; } } } And when I access this property in one of my form I am getting error. e.g. if (Properties.Type1.Equals(string.Empty) || Properties.Type1.Equals(null)) { //// Do something }

    Read the article

  • Using a delegate to populate a listbox

    - by Leroy Jenkins
    Ive been playing around with delegates trying to learn and I ran into one small problem Im hoping you can help me with. class myClass { OtherClass otherClass = new OtherClass(); // Needs Parameter otherClass.SendSomeText(myString); } class OtherClass { public delegate void TextToBox(string s); TextToBox textToBox; public OtherClass(TextToBox ttb) // ***Problem*** { textToBox = ttb; } public void SendSomeText(string foo) { textToBox(foo); } } the form: public partial class MainForm : Form { OtherClass otherClass; public MainForm() { InitializeComponent(); otherClass = new OtherClass(this.TextToBox); } public void TextToBox(string aString) { listBox1.Items.Add(aString); } } Obviously this doesnt compile because the OtherClass constructor is looking for TextToBox as a parameter. How would you recommend getting around the issue so I can get an object from myClass into the textbox in the form?

    Read the article

  • How to make WPF app work as a child process in Citrix

    - by RichardOD
    I am working on a 3rd party application that allows plugins to be written in .NET 1.1. I have decided I would like to write my plugin in a seperate process that is called from the .NET 1.1 application (achieved using Process.Start). This is fine- I create a new process that is a WPF app. When I launch this through MSTSC everything works as expected, however when I run the app through Citrix, the WPF child app fails to render correctly, and the mouse position starts going crazy- the child process window is basically not usable. Is there a way to avoid this happening? If I create a seperate WPF application and deploy this through Citrix everything works fine. If I create a child Windows forms app in .NET 3.5, that also works fine.

    Read the article

  • How do I make a form transparent while keeping the controls fully visible?

    - by Power-Mosfet
    I would like to have a form in which the controls on the form are fully visible but the form itself is invisible. If I change the form's Opacity, this makes both the form and the controls on it semi-transparent, so this doesn't work. I can't do this by setting the form's TransparencyKey, since I have a PictureBox on the form. If the image in the PictureBox happens to contain pixels that match the TransparencyKey, they appear as openings in the form, which I don't want.

    Read the article

  • Why does this tooltip appear *below* a transclucent form?

    - by Daniel Stutzbach
    I have an form with an Opacity less then 1.0. I have a tooltip associated with a label on the form. When I hover the mouse over the label, the tooltip shows up under the form instead of over the form. If I leave the Opacity at its default value of 1.0, the tooltip correctly appears over the form. However, my form is obviously no longer translucent. ;-) I'm testing on an XP system with .NET 3.5. If you don't see this problem on your system, let me know what operating system and version of .NET you have. I have tried manually adjusting the position of the ToolTip with SetWindowPos() and creating a ToolTip "by hand" using CreateWindowEx(), but the problem remains. This makes me suspect its a Win32 API problem, not a problem with the Windows Forms implementation that runs on top of Win32. Why does the tooltip appear under the form, and, more importantly, how can I get it to appear over the form where it should? Here is a minimal program to demonstrate the problem: using System; using System.Windows.Forms; public class Form1 : Form { private ToolTip toolTip1; private Label label1; [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } public Form1() { toolTip1 = new ToolTip(); label1 = new Label(); label1.Location = new System.Drawing.Point(105, 127); label1.Text = "Hover over me"; label1.AutoSize = true; toolTip1.SetToolTip(label1, "This is a moderately long string, " + "designed to be very long so that it will also be quite long."); ClientSize = new System.Drawing.Size(292, 268); Controls.Add(label1); Opacity = 0.8; } }

    Read the article

  • How can I change what happens when "enter" key is pressed on a DataGridView?

    - by SO give me back my rep
    when I am editing a cell and press enter the next row is automatically selected, I want to stay with the current row... I want to happen nothing except the EndEdit. I have this: private void dtgProductos_CellEndEdit(object sender, DataGridViewCellEventArgs e) { dtgProductos[e.ColumnIndex, e.RowIndex].Selected = true; //this line is not working var index = dtgProductos.SelectedRows[0].Cells.IndexOf(dtgProductos.SelectedRows[0].Cells[e.ColumnIndex]); switch (index) { case 2: { dtgProductos.SelectedRows[0].Cells[4].Selected = true; dtgProductos.BeginEdit(true); } break; case 4: { dtgProductos.SelectedRows[0].Cells[5].Selected = true; dtgProductos.BeginEdit(true); } break; case 5: { btnAddProduct.Focus(); } break; default: break; } } so when I edit a row that is not the last one I get this error: Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.

    Read the article

  • Where to prompt for required file location at start of Win Forms application

    - by Murph
    I have an application that uses a file to store its data. I store the location of the file in the app settings so have two tests at startup: Do I have a setting for the file and Does the file (if I have a setting) exist If I fail either test I want to prompt the user for the file location - the mechanics of the are not the problem, I can read and write the app settings, fire off dialogs and otherwise request the data. If the user refuses to choose a file (or at least a file location) I want to exit the app. My problem is where to do this i.e. at what point in the flow of code. In an ideal world you start the app, show a splash screen, load the main form and run from there... I'm looking for a general pattern that allows me to slot the test for parameters into the right place so that I can prompt the user for whatever (and allowing that I have to worry about the fact that my splash screen is currently topmost for my app). I appreciate that this is a bit vague so will update this with code as we go along.

    Read the article

  • Event for "end edit" in a text box

    - by eli.rodriguez
    I am using a textbox in winform (c#) and using the text of to make consults in a database. But i need constantly consult the text of the textbox every time that text change. So for these i use the KeyUp. But this event is too slow. Is any event that just fire when the textbox editing has been finished ?. I consider for finish 2 conditions The control lost focus. The control has 200ms without keypress

    Read the article

  • Drag Drop copy file

    - by Graham Warrender
    I've perhaps done something marginally stupid, but can't see what it is!! string pegasusKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Pegasus\"; string opera2ServerPath = @"Server VFP\"; string opera3ServerPath = @"O3 Client VFP\"; string opera2InstallationPath = null; string opera3InstallationPath = null; //Gets the opera Installtion paths and reads to the string opera*InstallationPath opera2InstallationPath = (string)Registry.GetValue(pegasusKey + opera2ServerPath + "System", "PathToServerDynamic", null); opera3InstallationPath = (string)Registry.GetValue(pegasusKey + opera3ServerPath + "System", "PathToServerDynamic", null); string Filesource = null; string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false); foreach (string File in FileList) Filesource = File; label.Text = Filesource; if (System.IO.Directory.Exists(opera3InstallationPath)) { System.IO.File.Copy(Filesource, opera3InstallationPath); MessageBox.Show("File Copied from" + Filesource + "\n to" + opera3InstallationPath); } else { MessageBox.Show("Directory Doesn't Exist"); } The user drags the file onto the window, I then get the installation path of an application which is then used as the destination for the source file.. When the application is runs, it throws the error directory not found. But surely if the directory doesn't exists is should step into the else statement? a simple application that is becoming a headache!!

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >