Search Results

Search found 3559 results on 143 pages for 'winforms interop'.

Page 15/143 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • C# winforms: DataSet with multiple levels of related tables

    - by Jake
    Hi, I am trying to use DataSet and DataAdapter to "filter" and "navigate" DataRows in DataTables. THE SITUATION: I have multiple logical objects, e.g. Car, Door and Hinge. I am loading a Form which will display complete Car information including each Door and their respective Hinges. In this senario, The form should display info for 1 car, 4 doors and 2 hinges for each door. Is it possible to use a SINGLE DataSet to navigate this Data? i.e. 1 DataRow in car_table, 4 DataRow in door_table and 8 DataRow in hinge_table, and still be able to navigate correctly between the different object and their relations? AND, able to DataAdapter.Update() easily? I have read about DataRelation but don't really understand how to use it. Not sure if it is the correct direction for my problem. Appreciate any advise. Thanks!

    Read the article

  • WinForms "mini-windows"

    - by Poco
    I need to create some mini-windows, like the ones shown in the image bellow, in my winform main form. It would be nice if they could be draggable, resizable, and, mainly, closable. How can I approach this design? Has anybody already seen some control (with code available) implementing something similar?

    Read the article

  • Help with storing/accessing user access roles C# Winforms

    - by user222453
    Hello, firstly I would like to thank you in advance for any assistance provided. I am new to software development and have designed several Client/Server applications over the last 12 months or so, I am currently working on a project that involves a user logging in to gain access to the application and I am looking at the most efficient and "simple" method of storing the users permissions once logged in to the application which can be used throughout restricting access to certain tabs on the main form. I have created a static class called "User" detailed below: static class User { public static int _userID; public static string _moduleName; public static string _userName; public static object[] UserData(object[] _dataRow) { _userID = (int)_dataRow[0]; _userName = (string)_dataRow[1]; _moduleName = (string)_dataRow[2]; return _moduleName; } } When the user logs in and they have been authenticated, I wish to store the _moduleName objects in memory so I can control which tabs on the main form tab control they can access, for example; if the user has been assigned the following roles in the database: "Sales Ledger", "Purchase Ledger" they can only see the relevant tabs on the form, by way of using a Switch - Case block once the login form is hidden and the main form is instantiated. I can store the userID and userName variables in the main form once it loads by means of say for example: Here we process the login data from the user: DataAccess _dal = new DataAccess(); switch (_dal.ValidateLogin(txtUserName.Text, txtPassword.Text)) { case DataAccess.ValidationCode.ConnectionFailed: MessageBox.Show("Database Server Connection Failed!"); break; case DataAccess.ValidationCode .LoginFailed: MessageBox.Show("Login Failed!"); _dal.RecordLogin(out errMsg, txtUserName.Text, workstationID, false); break; case DataAccess.ValidationCode .LoginSucceeded: frmMain frmMain = new frmMain(); _dal.GetUserPrivList(out errMsg,2); //< here I access my DB and get the user permissions based on the current login. frmMain.Show(); this.Hide(); break; default: break; } private void frmMain_Load(object sender, EventArgs e) { int UserID = User._userID; } That works fine, however the _modules object contains mutiple permissions/roles depending on what has been set in the database, how can I store the multiple values and access them via a Switch-Case block? Thank you again in advance.

    Read the article

  • Form invalidate() in WinForms Application

    - by Pramodh
    i need to animate an object in c# windows application int l_nCircleXpos = 9, l_nCircleYpos = 0; private void Form1_Paint(object sender, PaintEventArgs e) { Graphics l_objGraphics = this.CreateGraphics(); Pen l_circlePen = new Pen(Color.Blue); SolidBrush l_circleBrush = new SolidBrush(Color.Blue); l_objGraphics.DrawEllipse(l_circlePen, l_nCircleXpos, l_nCircleYpos, 30, 30); l_objGraphics.FillEllipse(l_circleBrush, l_nCircleXpos, l_nCircleYpos, 30, 30); Pen l_rectPen = new Pen(Color.Red); } private void timer1_Tick(object sender, EventArgs e) { l_nCircleXpos++; l_nCircleYpos++; } private void timer2_Tick(object sender, EventArgs e) { Invalidate(); } but in timer2 its invalidating the entire form. i need to invalidate the specific circle area only. please help to do this in a better way

    Read the article

  • c# winForms open forms inside mainform

    - by user508284
    Hello guys, I have programmed c# application i will post screenshot. In this main form is 3 buttons which opens different forms. Now i decided to modify this application I want to Make one main form with strip menu which will open this forms. I used this code but i don't like or i'm doing something wrong. I don't like because there is child controls(minimize, maximize, close) in parent (please see second picture ): Please advice me something. Is MDI good for such job? Thanks! Sell sell = new Sell(); sell.MdiParent = this; sell.Dock = DockStyle.Fill; sell.Show();`

    Read the article

  • Hidden Features of Visual Studio winforms designer

    - by CodingBarfield
    One of the most loved and hated feautures of visual studio must be the form designer. Creating a simple form/user control layout usually is a breeze. Setting properties and adding events is easy. Setting up the toolbox to use you own controls can be a bit harder and getting the ToolBoxIcons to show up can be a pain. Using third party components by visual inheritance can throw of the designer. And using multiple inheritance on designerables can be really hard. So what are your favorite 'hidden' and or obvious visual studio designer features.

    Read the article

  • C# WinForms. Multiple Forms in separate threads

    - by Calum Murray
    I'm trying to run an ATM Simulation in C# with Windows Forms that can have more than one instance of an ATM machine transacting with a bank account simultaneously. The idea is to use semaphores/locking to block critical code that may lead to race conditions. My question is this: How can I run two Forms simultaneously on separate threads? In particular, how does all of this fit in with the Application.Run() that's already there? Here's my main class: public class Bank { private Account[] ac = new Account[3]; private ATM atm; public Bank() { ac[0] = new Account(300, 1111, 111111); ac[1] = new Account(750, 2222, 222222); ac[2] = new Account(3000, 3333, 333333); Application.Run(new ATM(ac)); } static void Main(string[] args) { new Bank(); } } ...that I want to run two of these forms on separate threads... public partial class ATM : Form { //local reference to the array of accounts private Account[] ac; //this is a reference to the account that is being used private Account activeAccount = null; private static int stepCount = 0; private string buffer = ""; // the ATM constructor takes an array of account objects as a reference public ATM(Account[] ac) { InitializeComponent(); //Sets up Form ATM GUI in ATM.Designer.cs this.ac = ac; } ... I've tried using Thread ATM2 = new Thread(new ThreadStart(/*What goes in here?*/)); But what method do I put in the ThreadStart constructor, since the ATM form is event-driven and there's no one method controlling it? Thanks, Calum

    Read the article

  • C# / Winforms - Visually remove button click event

    - by Wayne Koorts
    .NET newbie alert Using Visual C# 2008 Express Edition I have accidentally created a click event for a button. I then deleted the automatically-created method code, which resulted in an error saying that the function, which had now been referenced in the form loading code, could no longer be found. Deleting the following line from the Form1.Designer.cs file's InitializeComponent() function... this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click); ... seems to do the trick, however, it makes me feel very dirty because of the following warning at the beginning of the #region: /// Required method for Designer support - do not modify /// the contents of this method with the code editor. I haven't been able to find a way to do this using the form designer, which I assume is the means implied by this warning. What is the correct way to do this?

    Read the article

  • Winforms, databinding, Listbox and textbox

    - by Snake
    Hi dear friends, I have a ListBox (MyListBox) on my screen, and a Textbox (MyTextBox). The ListBox is filled with a List(Of T), which are all custom items. Now I try to do this: The ListBox' datasource is the List(Of T). Now when an Item changes I want the textbox to be updated to a particular property of the selected item in my ListBox. In code this means: Me.MyListBox.DisplayMember = "SelectionName" Me.MyListBox.ValueMember = "Id" MyTextbox.DataBindings.Add(New Binding("Text", Me._listOfItems, "SelectedItem.Comment", True, DataSourceUpdateMode.OnPropertyChanged)) Me.MyListBox.DataSource = Me._listOfItems this does not work. But when I bind to SelectedValue instead of SelectedItem it works perfectly. The _listOfItems is declared as this: Dim _listOfItems As List(Of MyItem) = New List(Of MyItem)() Where MyItem is this: public class MyItem { public string SelectionName { get; set; } public int Id { get; set; } public string Comment { get; set; } } I tried overriding the ToString() in MyItem so that it would use that. But that doesn't work either. Anybody care to give it a try? Thanks! -Snakiej

    Read the article

  • WinForms modal windows alt+tab problem

    - by PaN1C_Showt1Me
    Hi ! Suppose multiple Modal Windows shown above each other. All of those have ShowInTaskbar = false, which means that in the TaskBar you only see the MainForm and all Modal Windows are hidden. Now you press ALT+ TAB and the most upper modal Windows disappears. But you cannot get it back in front. How should be this done correctly in your opinion?

    Read the article

  • Winforms for Mono on Mac, Linux and PC (Redux)

    - by yar
    (I asked this question in another way, and got some interesting responses but I'm not too convinced.) Is Mono's GtkSharp truly cross-platform? It seems to be Gnome based... how can that work with PC and Mac? Can someone give me examples of a working Mac/PC/Linux app that is written with a single codebase in Microsoft .Net?

    Read the article

  • Datagridview Winforms Add or Delete Rows in Edit Mode with Collection Binding

    - by user630548
    In my datagridview, I bind a List of objects named 'ProductLine'. But unfortunately with this approach I cannot 'Add' or 'Delete' rows to the datagridview in edit mode. When I create a fresh new order I can Add or Delete rows but once I save it and try to open it in Edit then it doesn't let me 'Add' or 'Delete' (via keyboard). Any idea? Here is the code for this: If it is a fresh Order then I do something like this: private void Save(){ for (int i = 0; i <= dtgProdSer.RowCount - 1; i++) { if ((itemList != null) && (itemList.Count > i)) productLine = itemList[i]; else productLine = new ProductLine(); productLine.Amount = Convert.ToDouble(dataGridViewTextBoxCell.Value); } } And if it is an Edit then in the Form_Load I check ProductId is NON Zero then I do the following: private void fillScreen{ dtgProdSer.DataSource = itemList; } But with this I cannot Add or Delete Rows in Edit mode. Any advise is greatly appreciated.

    Read the article

  • MainMenu with Images (WinForms, C#)

    - by j-t-s
    Hi All 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? Thanks

    Read the article

  • passing values between forms (winforms)

    - by dnkira
    Hello. Vierd behaviar when passing values to and from 2nd form. ParameterForm pf = new ParameterForm(testString); works ParameterForm pf = new ParameterForm(); pf.testString="test"; doesn't (testString defined as public string) maybe i'm missing something? anyway i'd like to make 2nd variant work properly, as for now - it returns null object reference error. thanks for help. posting more code here: calling Button ParametersButton = new Button(); ParametersButton.Click += delegate { ParameterForm pf = new ParameterForm(doc.GetElementById(ParametersButton.Tag.ToString())); pf.ShowDialog(this); pf.test = "test"; pf.Submit += new ParameterForm.ParameterSubmitResult(pf_Submit); }; definition and use public partial class ParameterForm : Form { public string test; public XmlElement node; public delegate void ParameterSubmitResult(object sender, XmlElement e); public event ParameterSubmitResult Submit; public void SubmitButton_Click(object sender, EventArgs e) { Submit(this,this.node); Debug.WriteLine(test); } } result: Submit - null object reference test - null object reference

    Read the article

  • How can I attach a Silverlight OOB to a Winforms panel?

    - by JohnMcCon
    Summary: I want the prettiness of Silverlight/WPF in part of my current Winforms application. The application can only have access to the full .NET Framework 2.0, no more and no less. The only possibility I can think of is a Silverlight OOB application that utilizes Com+ Automation but I can't figure out how to attach the Silverlight application to a panel within the parent Winforms application. Details: I currently have a winforms application, and want to take advantage of the improved GUI features in WPF but to many of my users are still running .Net Framework 2.0 and refuse to update to 3+. So WPF is not an option for me. I know Silverlight is just a subset of WPF, but it has most of the features I'm looking for and only requires the Silverlight plug-in. I've read about Silverlight 4's Com+ Automation, which would give me access to the full desktop .Net Framework 2.0 (which I need). In order for Com+ Automation to work in Silverlight I need elevated trust and the only way I can find to gain elevated trust is to make my Silverlight application Out-Of-Browser (OOB). My problem is that the OOB application seems to run in its own container window and I need the Silverlight application embedded inside a panel in my Winforms application. My Winforms application does not need to communicate with the Silverlight application and vice-versa, this is purely to have everything contained and displayed in one window. If there is another way to get my desired result that I have not thought of feel free to suggest it.

    Read the article

  • .net question - where are the DefaultCredentials stored/accessed from for a WinForms v3.5 app?

    - by Greg
    Hi, Where are the DefaultCredentials stored/accessed from for a WinForms v3.5 app? That is if I am using the settings for defaultProxy for my Winforms v3.5 application, and set a proxy server address here, exactly where does/can the username/password come from? Or in other words where does the framework source the "default credentials" for a winforms application running on the client PC? <defaultProxy enabled="true|false" useDefaultCredentials="true|false" <bypasslist> … </bypasslist> <proxy> … </proxy> <module> … </module> /> Background - apparently ClickOnce can use this for a client side application, however I'm trying to work out where click once would get this defaultCredential from, for a user who is running the clickonce install for my winforms application.

    Read the article

  • How to access the Desktop Composition Engine from a WinForms app?

    - by MusiGenesis
    Is it possible to access Desktop Composition Engine in Windows Vista from a winforms application? The DCE apparently involves applications rendering to DCE buffers instead of directly to the screen. Since a winforms app has no way of getting information about the monitor's refresh rate and scanline status (other than via DirectX), animation in a winforms app is subject to tearing effects. With DCE enabled, the tearing effects are lessened but still there (apparently the DCE can still grab a buffer that your app is halfway through writing to and render it to the screen, thereby producing the half-one-frame-half-of-the-next tearing effects). Is there any way for my winforms app to communicate with the DCE and possible avoid rendering during buffer switchover times?

    Read the article

  • How can I schedule tasks in a WinForms app?

    - by Greg
    QUESTION: How can I schedule tasks in a WinForms app? That is either (a) what is the best approach / .NET classes/methods to use of (b) if there is an open source component that does this well which one would be recommended. BACKGROUND: Winforms app (.NET v3.5, C#, VS2008) I'm assuming I will run the winforms application always, and just minimise to the system tray when not in use Want a simple approach (didn't want to get into separate service running that UI winforms app talks to etc) Want to be able to let the user select how often to schedule the sync (e.g. hourly, daily - pick time, etc) Ability to at the times when the scheduler fires to run a chunk of code (assume it could be wrapped as a backgroundworker task for example) The application is always running & appears in the system tray

    Read the article

  • Is there a compact or express SQL Server version that I can package with my WinForms app & is free?

    - by Greg
    Hi, Is there a light weight version of SQL Server I could use that has the characteristics of: Free (assuming my winforms app is semi-commercial) Can be seemlessly packaged for deployment as part of the winforms click-once application? (i.e. ease in installation for the user). Light weight for the user (ideally something that just runs when the winforms application that uses it is running - but better than using XML sererialization for persistance). Thanks

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >