Search Results

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

Page 24/113 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • How to implement a .net 3-tier architecture using Winforms

    - by Anders Jakobsen
    I have for some time build n-tier Applications using a database server as the data tier, Winforms as the presentation tier and an ASP.NET asmx webservice in the middle to send back and forth untyped Datasets. While this approach has worked for me so far, it certainly does feel outdated today. What technologies should I use if I were to create a similar architectured application today? .net 4.0 technology is welcome. I still want a database server as the datatier and the asmx webservices should probably be replaced by WCF. I would still like to have the presentation tier running as a desktop application (Winforms or WPF) so ignore ASP.net for this question. My main question really comes down to what to use as business objects. I want something that is easier to bind to the interface than untyped Datasets and strongly-typed datasets feels very heavy. I also need something that can track changes to make sure users do not override each other's changes in the database. Will the Entity Framework 4 be usable for a scenario like this? Are there any thorough guides available?

    Read the article

  • Bug with DataBinding in WPF Host in Winforms?

    - by Tigraine
    Hi Guys, I've spent far too much time with this and can't find the mistake. Maybe I'm missing something very obvious or I may have just found a bug in the WPF Element Host for Winforms. I am binding a ListView to a ObeservableList that lives on my ProductListViewModel. I'm trying to implement searching for the ListView with the general Idea to just change the ObservableList with a new list that is filtered. Anyway, the ListView Binding code looks like this: <ListView ItemsSource="{Binding Path=Products}" SelectedItem="{Binding Path=SelectedItem}" SelectionMode="Single"> <ListView.ItemContainerStyle> <Style TargetType="{x:Type ListViewItem}"> <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"></Setter> </Style> </ListView.ItemContainerStyle> <ListView.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Name}"></TextBlock> </DataTemplate> </ListView.ItemTemplate> </ListView> And the ViewModel code is as vanilla as it can get: private ObservableCollection<ProductViewModel> products; public ObservableCollection<ProductViewModel> Products { get { return products; } private set { if (products != value) { products = value; OnPropertyChanged("Products"); } } } Now the problem here: Once I debug into my OnPropertyChanged method, I can see that there are no subscribers to the PropertyChanged event (it's null), so nothing happens on the UI.. I already tried Mode=TwoWay and other Binding modes, it seems I can't get the ListView to subscribe to the ItemsSource... Can anyone help me with this? I'm just about to forget about the ElemenHost and just do it in Winforms greetings Daniel

    Read the article

  • C#: Fill DataGridView From Anonymous Linq Query

    - by mdvaldosta
    // From my form BindingSource bs = new BindingSource(); private void fillStudentGrid() { bs.DataSource = Admin.GetStudents(); dgViewStudents.DataSource = bs; } // From the Admin class public static List<Student> GetStudents() { DojoDBDataContext conn = new DojoDBDataContext(); var query = (from s in conn.Students select new Student { ID = s.ID, FirstName = s.FirstName, LastName = s.LastName, Belt = s.Belt }).ToList(); return query; } I'm trying to fill a datagridview control in Winforms, and I only want a few of the values. The code compiles, but throws a runtime error: Explicit construction of entity type 'DojoManagement.Student' in query is not allowed. Is there a way to get it working in this manner?

    Read the article

  • .NET Usercontrols telerik devexpress infragistics ComponentOne: who's best?

    - by petebob796
    I am considering the purchase of some .NET user controls with interest in both WinForms and asp.net. I have trialed in the past devexpress when I needed a hierarchical data grid for a personal project which I was impressed with. Rather than just jump for them I am interested in peoples experience of different products such as: TelerikDev ExpressInfragistics ComponentOne Any Others? I would like peoples opinions on: - Features Set and Number of Controls - Installation and Upgrade - Ease of use - Documentation - Price - License - Development (Updates to controls their side) Also if anyone has any links to review (hopefully side by side) please post them

    Read the article

  • custom events in child userControls c# .net or Child to Parent Communication in UserControls

    - by Asad Malik
    Okay here is the scenario: I have a parent "SalesUC" UserControl which contains a "itemDetailsUC" UserControl, as well as a status label. (plz see sample below) What I want: If there occurs any exception in itemDetailsUC, it should be able to communicate the exception text to parent control (i.e. SalesUC). Remember: the "ItemDetailsUC" is also used in other controls that may or may not have status label. any suggestions, answers... please. Framework: .net 3.0/3.5 Language: c# Domain: Windows Application, WinForms, etc. Sample ScreenShot regards.

    Read the article

  • Random Gui errors using C# Mono on OSX

    - by Erik Karlsson
    Hello. Im developing a app in c# (winforms), which uses mono to run on osx. It contains some dynamic controls, for example a custom groupbox which contains some labels and textboxes, a button etc. these boxes can both be added and removed dynamically. Problem arises both when they are created, and removed, or even when a messagebox is shown. What happens is that sometimes on rendering white boxes appears, or some labels are not drawn correctly. And sometimes when a messagebox appears, it first opens up like 5 dummies which are just blank, and which you cant close. Am i doing something wrong, should i sleep the gui thread a bit after each creation, or should i invalidate stuff on my own? Or should i try GTK#? Many thanks on input on this, Erik

    Read the article

  • ToolStrip control never fire Enter/Leave event??

    - by AZ
    I created a movable panel in WinForms. I use a ToolStrip as a titlebar in the panel. I'll use the ToolStrip to move the panel as well as indicating the panel is "active" or not. So when the panel is active, I want to change the ToolStrip's BackColor to Red. The idea is capturing ToolStrip's Enter/Leave event to change the color, but it seems those events are never fired. Are those events truly never fired? Should I capture other events?

    Read the article

  • NHibernate Session Management Advice

    - by Hugusta
    I need some advice on NHibernate Session Management for a C# WinForms application. I am currently porting an application to use NHibernate. I am also employing a UnitOfWork pattern as described in the link below; http://nhforge.org/wikis/patternsandpractices/nhibernate-and-the-unit-of-work-pattern.aspx My question relates to Sessions. Can you only have one session running per thread at all times? I have a scenario in which a Session (UnitOfWork) may be open for a form shown by the application but the user opens another form (i.e. Tools - Options) which I would like to have its own UnitOfWork. Clearly in this instance it would make more sense to open another Session for the "Tools - Options" form and not use the currently open session for the underlying form. Can we have a Dictionary of Sessions on the one thread? Any advice on session management is appreciated.

    Read the article

  • Close PrintPreviewDialog when ESC is pressed

    - by Emerick Rogul
    I'm working on a WinForms application that uses System.Windows.Forms.PrintPreviewDialog to display a Print Preview dialog. When the user presses ESC in that dialog, I'd like to close the dialog. Unfortunately, I can't figure out how to do this. I've tried to install a KeyDown/PreviewKeyDown event handler, but it never gets called. I also tried setting focus to the dialog (and to its PrintPreviewControl), thinking that was the issue, but that didn't help either. Does anyone have any idea how to make this work?

    Read the article

  • Sharp Architecture for Winform apps?

    - by CF_Maintainer
    The Sharp Architecture Contrib seems to suggest it is possible. It seemed like they had a dependency on "PostSharp" which has now been replaced with Castle interceptors. Has anyone used the Sharp Architecture for a non Web project? How was the experience? Does that mean one is locked in with castle as the IoC container when using Sharp architecture for non web purposes? If not Sharp Architecture, then what are some of the favored application frameworks for the non web world [spring.NET?] ? If one were to start a green field Winforms app, what application framework would be desirable?

    Read the article

  • How to bind a List of a DataObject to a Grid with BindingSources?

    - by citronas
    In an assembly I created a class like the following: [DataObject(true)] public class A { public int Foo{get;set;} [DataObjectMethod[DataObjectMethodType.Select)] public static List<A> GetAllA(string ConnectionString) { // return filled List<A> } } Now I want to display this List with a Gridcontrol under Winforms. I though of a DataGrid. Though I'm coming from ASP.net I'd first think of this.dataGridView1.DataSource = A.GetAllA(ConnectionString) Works, but I'd prefer a better databinding with BindingSources. (Because I've always heard that thats the way to go) I managed to drop a BindingSource onto the form and set the DataSource property to class A. But where can I set the SelectMethod and its parameters? If I set DataSource property of the dataGridView to the BindingSource, it will only display an empty line. Is this the right way to go? Will it only require some additional clicks in the wizard, or do I need to read tons of documentation to get this working?

    Read the article

  • Hiding Row in DataGridView Very Slow

    - by Ed Schwehm
    I have a DataGridView in a Winforms app that has about 1000 rows (unbound) and 50 columns. Hiding a column takes a full 2 seconds. When I want to hide about half the rows, this becomes a problem. private void ShowRows(string match) { this.SuspendLayout(); foreach (DataGridViewRow row in uxMainList.Rows) { if (match == row.Cells["thisColumn"].Value.ToString())) { row.Visible = false; } else { row.Visible = true; } } this.ResumeLayout(); } I did some testing by adding by addingConsole.WriteLine(DateTime.Now)around the actions, androw.Visible = falseis definitely the slow bit. Am I missing something obvious, like setting IsReallySlow = false? Or do I have to go ahead and enable Virtual Mode and code up the necessary events?

    Read the article

  • confusion about transactions and msdtc

    - by muhan
    I have some basic confusion about how transactions and msdtc work together. I have a basic server/client winforms app. The app uses transactionscope to encapsulate several sql commands that are executed on the sql server. The app seemed to work fine when I enabled msdtc network access on the server only. Then one day it stopped working saying network access was not enabled. Now it seems that I have to enable msdtc network access on both the client computer and server for transactionscope to work. Does the client or server msdtc service do the transaction work? Or maybe its both? Does anyone have guidance on whether msdtc network access is needed on both client and server or just server?

    Read the article

  • C# - Determine if class initializaion causes infinite recursion?

    - by John M
    I am working on porting a VB6 application to C# (Winforms 3.5) and while doing so I'm trying to break up the functionality into various classes (ie database class, data validation class, string manipulation class). Right now when I attempt to run the program in Debug mode the program pauses and then crashes with a StackOverFlowException. VS 2008 suggests a infinite recursion cause. I have been trying to trace what might be causing this recursion and right now my only hypothesis is that class initializations (which I do in the header(?) of each class). My thought is this: mainForm initializes classA classA initializes classB classB initializes classA .... Does this make sense or should I be looking elsewhere? UPDATE1 (a code sample): mainForm namespace john { public partial class frmLogin : Form { stringCustom sc = new sc(); stringCustom namespace john { class stringCustom { retrieveValues rv = new retrieveValues(); retrieveValues namespace john { class retrieveValues { stringCustom sc = new stringCustom();

    Read the article

  • Control.EndInvoke resets call stack for exception

    - by Brian Rasmussen
    I don't do a lot of Windows GUI programming, so this may all be common knowledge to people more familiar with WinForms than I am. Unfortunately I have not been able to find any resources to explain the issue, I encountered today during debugging. If we call EndInvoke on an async delegate. We will get any exception thrown during execution of the method re-thrown. The call stack will reflect the original source of the exception. However, if we do something similar on a Windows.Forms.Control, the implementation of Control.EndInvoke resets the call stack. This can be observed by a simple test or by looking at the code in Reflector. The relevant code excerpt from EndInvoke is here: if (entry.exception != null) { throw entry.exception; } I understand that Begin/EndInvoke on Control and async delegates are different, but I would have expected similar behavior on Control.EndInvoke. Is there any reason Control doesn't do whatever it is async delegates do to preserve the original call stack?

    Read the article

  • How to fix weird scrolling/alignment behavior when using keyboard in MenuStrip?

    - by bentsai
    I started noticing strange behavior when navigating the main toolbar of my Winforms application, and I don't know how to fix it. When I initially open the dropdown of the File menu, it looks like this: I begin to scroll down each item with the arrow keys, and everything is fine until I reach "Exit". As soon as I hit the down arrow key from "Log Off", or if I hit the up arrow key from "Open", the menu rearranges itself to look like this: I'm puzzled by this behavior. The menu still works, and from this point, if I start scrolling up, I can get the arrangement back to normal: A few observations: The menu still works. This doesn't happen when using the mouse. I have some code that toggles the Visible property of some of the menu items. I was able to modify what the arrangement was by playing around with this, but it was still messed up. Can anyone help me understand what is going on, and how to fix it?

    Read the article

  • LB_SETTABSTOPS does not appear to affect a CheckedListBox

    - by BP
    I am trying to set tab stops in a CheckedListBox in my WinForms application, but no matter what I do, it does not seem to have any effect. I have the following in the code for my form: <DllImport("user32.dll")> _ Public Sub SendMessage(ByVal hWnd As IntPtr, ByVal uMsg As Int32, ByVal wParam As Int32, ByRef lParam As Int32) End Sub Public Const LB_SETTABSTOPS As Int32 = &H192 And in the form's load method, I am doing the following, where theList is my CheckedListBox: Dim tabStops() As Integer = {40, 140, 240} Call SendMessage(theList.Handle, LB_SETTABSTOPS, tabStops.Length, tabStops(0)) theList.Refresh() And then later on, I use this in a loop, where col1 through col4 are all string values for the columns: theList.Items.Add(col1 & vbTab & col2 & vbTab & col3 & vbTab & col4) But no matter what I use for the values of tabStops, the list is formatted with standard width tab stops.

    Read the article

  • How can I make datagridview can only select the cells in the same column at a time?

    - by MemoryLeak
    I am using winforms to develop my application. And I set my datagridview control's selectionmode to "CellSelect", and this allow the user to select as many cells as he want which spread over several columns; but I want to constraint my user can only select cells in single column at a time, and there isn't any such kind of selectionmode for me. So If I want to implement this, how can I extend the datagridview class ? I also think that I can check in eventhandler whenever the selection cells are changed, through which I might make the user can not select cells spread over multiple columns, but this is not that good, I think. Can any other people help me to find out a better solution ?

    Read the article

  • C#: Two forms, one is calling the other one

    - by Shaza
    Hey all, I have a problem like this, I have two Winforms, f1 and f2. f1 will start a loop on button click, this loop checks a condition and decide to call the other form which is f2 or not. The problem is, the loop may call f2 many times, so each time the other form f2 will be called the first form f1 should pause its execution. So, I solved it like this, I used backgroundWorker + AutoResetEvent. I placed the backgroundWorker in the first form and inside the DoWork event handler I called f2.Show() then I called WaitOne on the AutoResetEvent let it be A. In the other form "f2", on Exiting button I called Set on the same A. But, unfortunately f2 got freezed when clicking that button in f1, what should I change??

    Read the article

  • Mark row as deleted in dataTable on

    - by dav.evans
    I have a datatable bound to a winforms dataGridView via a BindingSourceControl. I want to be able handle the UserDeletingRow event from the dataGridView and mark the row in my dataTable as deleted. I need to then be able to retrieve the rows marked as deleted from the datatable so that I can delete them from my database when a Save button is clicked. Please not I dont want to delete from the database on each firing of UserDeletingRow, only mark that row as deleted in my dataset. Can anyone point out how to do this?

    Read the article

  • RichTextBox doesn't update caret position correctly

    - by shadeMe
    I have a handler consuming the keyDown event of a WinForms RTB, that has the following code: GetTextAtLoc(RTB->SelectionStart); // selects some text at the caret's position RTB->SelectedText = "SomeOfMyOwn"; GetTextAtLoc(RTB->SelectionStart); // selects the replacement string RTB->SelectionStart += RTB->SelectionLength - 1; While this code seems to do its job (SelectionStart/Length properties are updated correctly), the caret doesn't move to the end of the new string - It says right where it was at the time of GetTextAtLoc's first call. Redrawing the textbox does seem to have any effect either.

    Read the article

  • What could make GetCursorPos return incorrect coordinates of {0,0} ?

    - by Dave Moore
    We are seeing bad behavior in an application when it runs on Server 2008 (not R2). This is a WinForms application, and Control.MousePosition is returning {0,0} no matter where the mouse is on the screen... Control.MousePosition just makes a P/Invoke call to Win32 api GetCursorPos(). There is a control in our library that calls SetWindowsHookEx to hook WH_CALLWNDPROCRET for our entire process. I'm suspicious of this code, but tracing statements show that we're getting in + out of that hook cleanly. What else should I be looking for? Thanks, Dave

    Read the article

  • ProcessCmdKey - wait for KeyUp?

    - by Tom Frey
    Hi, I'm having the following issue in a WinForms app. I'm trying to implement Hotkeys and I need to process Key messages whenever the control is active, no matter if the focus is on a textbox within that control, etc. Overriding ProcessCmdKey works beautifully for this and does exactly what I want with one exception: If a user presses a key and keeps it pressed, ProcessCmdKey keeps triggering WM_KEYDOWN events. However, what I want to achieve is that the user has to release the button again before another hotkey action would trigger (so, if someone sits on the keyboard it would not cause continuous hotkey events). However, I can't find where to catch WM_KEYUP events, so I can set a flag if it should process ProcessCmdKey messages again? Anyone can help out here? Thanks, Tom

    Read the article

  • Is WPF the Future of Windows UI Development?

    - by Randy Minder
    We're debating whether our future Windows UI development should be WinForms or WPF. How have some of you made this decision? Most of our applications are LOB applications, and I'm not sure I see a clear and overwhelming benefit to WPF for these types of applications. However, my knowledge of WPF is limited. I'm also a little concerned that WPF will be in vogue for another couple years and then Microsoft will get tired of it and push something else on us. I guess one argument against this is the fact that Visual Studio 2010 is a WPF application. Thanks.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >