Search Results

Search found 10936 results on 438 pages for 'wpf controls'.

Page 4/438 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • WPF: Drag/Drop to re-order grid and jiggle

    - by Echilon
    I need to implement a grid in WPF which has squares that can be dragged/dropped to be re-ordered, but I'm not sure the best way to do it. I was thinking using an ObservableCollection of squares and a UniFormGrid but although I have experience with both WPF and drag/drop, ideally I'd like to do a kind of 'jiggle' when before the user releases the mouse. Any suggestions on a good starting point?

    Read the article

  • Best practices for dimensioning control panels in WPF

    - by vizcaynot
    Hello: I defined a Window in WPF, into this one I put a "stack panel" and inside this panel I put a "tab control" and some "button controls". When executing the program, I would like that when I have to resize the window using the mouse, the stack panel and all controls inside it can also be resized automatically and proportionally to the window. How can I get this? Thanks!!

    Read the article

  • WPF: Restyling a window?

    - by mark smith
    Hi there, does anyone know if its possible to restyle a window in wpf. Or even better any tutorials or samples? Basically i would like to change the minimize and maximize buttons - oh and the close button to be slightly bigger.... I have expression blend.... Is this possible? I saw some samples in infragistics sample apps which have some great looking forms and as far as i can tell it doesn't use any custom wpf controls... Any ideas really appreciated

    Read the article

  • WPF Login Verification Using Active Directory

    - by psheriff
    Back in October of 2009 I created a WPF login screen (Figure 1) that just showed how to create the layout for a login screen. That one sample is probably the most downloaded sample we have. So in this blog post, I thought I would update that screen and also hook it up to show how to authenticate your user against Active Directory. Figure 1: Original WPF Login Screen I have updated not only the code behind for this login screen, but also the look and feel as shown in Figure 2. Figure 2: An Updated WPF Login Screen The UI To create the UI for this login screen you can refer to my October of 2009 blog post to see how to create the borderless window. You can then look at the sample code to see how I created the linear gradient brush for the background. There are just a few differences in this screen compared to the old version. First, I changed the key image and instead of using words for the Cancel and Login buttons, I used some icons. Secondly I added a text box to hold the Domain name that you wish to authenticate against. This text box is automatically filled in if you are connected to a network. In the Window_Loaded event procedure of the winLogin window you can retrieve the user’s domain name from the Environment.UserDomainName property. For example: txtDomain.Text = Environment.UserDomainName The ADHelper Class Instead of coding the call to authenticate the user directly in the login screen I created an ADHelper class. This will make it easier if you want to add additional AD calls in the future. The ADHelper class contains just one method at this time called AuthenticateUser. This method authenticates a user name and password against the specified domain. The login screen will gather the credentials from the user such as their user name and password, and also the domain name to authenticate against. To use this ADHelper class you will need to add a reference to the System.DirectoryServices.dll in .NET. The AuthenticateUser Method In order to authenticate a user against your Active Directory you will need to supply a valid LDAP path string to the constructor of the DirectoryEntry class. The LDAP path string will be in the format LDAP://DomainName. You will also pass in the user name and password to the constructor of the DirectoryEntry class as well. With a DirectoryEntry object populated with this LDAP path string, the user name and password you will now pass this object to the constructor of a DirectorySearcher object. You then perform the FindOne method on the DirectorySearcher object. If the DirectorySearcher object returns a SearchResult then the credentials supplied are valid. If the credentials are not valid on the Active Directory then an exception is thrown. C#public bool AuthenticateUser(string domainName, string userName,  string password){  bool ret = false;   try  {    DirectoryEntry de = new DirectoryEntry("LDAP://" + domainName,                                           userName, password);    DirectorySearcher dsearch = new DirectorySearcher(de);    SearchResult results = null;     results = dsearch.FindOne();     ret = true;  }  catch  {    ret = false;  }   return ret;} Visual Basic Public Function AuthenticateUser(ByVal domainName As String, _ ByVal userName As String, ByVal password As String) As Boolean  Dim ret As Boolean = False   Try    Dim de As New DirectoryEntry("LDAP://" & domainName, _                                 userName, password)    Dim dsearch As New DirectorySearcher(de)    Dim results As SearchResult = Nothing     results = dsearch.FindOne()     ret = True  Catch    ret = False  End Try   Return retEnd Function In the Click event procedure under the Login button you will find the following code that will validate the credentials that the user types into the login window. C#private void btnLogin_Click(object sender, RoutedEventArgs e){  ADHelper ad = new ADHelper();   if(ad.AuthenticateUser(txtDomain.Text,         txtUserName.Text, txtPassword.Password))    DialogResult = true;  else    MessageBox.Show("Unable to Authenticate Using the                      Supplied Credentials");} Visual BasicPrivate Sub btnLogin_Click(ByVal sender As Object, _ ByVal e As RoutedEventArgs)  Dim ad As New ADHelper()   If ad.AuthenticateUser(txtDomain.Text, txtUserName.Text, _                         txtPassword.Password) Then    DialogResult = True  Else    MessageBox.Show("Unable to Authenticate Using the                      Supplied Credentials")  End IfEnd Sub Displaying the Login Screen At some point when your application launches, you will need to display your login screen modally. Below is the code that you would call to display the login form (named winLogin in my sample application). This code is called from the main application form, and thus the owner of the login screen is set to “this”. You then call the ShowDialog method on the login screen to have this form displayed modally. After the user clicks on one of the two buttons you need to check to see what the DialogResult property was set to. The DialogResult property is a nullable type and thus you first need to check to see if the value has been set. C# private void DisplayLoginScreen(){  winLogin win = new winLogin();   win.Owner = this;  win.ShowDialog();  if (win.DialogResult.HasValue && win.DialogResult.Value)    MessageBox.Show("User Logged In");  else    this.Close();} Visual Basic Private Sub DisplayLoginScreen()  Dim win As New winLogin()   win.Owner = Me  win.ShowDialog()  If win.DialogResult.HasValue And win.DialogResult.Value Then    MessageBox.Show("User Logged In")  Else    Me.Close()  End IfEnd Sub Summary Creating a nice looking login screen is fairly simple to do in WPF. Using the Active Directory services from a WPF application should make your desktop programming task easier as you do not need to create your own user authentication system. I hope this article gave you some ideas on how to create a login screen in WPF. NOTE: You can download the complete sample code for this blog entry at my website: http://www.pdsa.com/downloads. Click on Tips & Tricks, then select 'WPF Login Verification Using Active Directory' from the drop down list. Good Luck with your Coding,Paul Sheriff ** SPECIAL OFFER FOR MY BLOG READERS **We frequently offer a FREE gift for readers of my blog. Visit http://www.pdsa.com/Event/Blog for your FREE gift!

    Read the article

  • controls layout WPF

    - by jonathan
    i have a LOB application with 30 fields to put in a form. I found it very painful to put them in the window with a grid. is there a productive way to build entry forms in WPF . Thanks John

    Read the article

  • Dragging Controls on Form at runtime

    - by j-t-s
    Hi All I've just started using WPF. But I'm trying to add my code that (from Winforms) enables the user to drag any control whereever they wish at runtime. But I can't seem to get the current Location of the mouse... Eh? There is no Location for Mouse? :(

    Read the article

  • WPF How to add and perform events on those controls generated during Runtime

    - by 103318677739703278524
    For example, I have an empty tabControl in my Windows during the compile time, and I have an undetermined amount of images need to be added onto the tabControl, so I used loop + tabControl.Children.Add("image1 to x") to add those images... but after that during runtime, I want to perform events on those image controls, such as dragging the image from the tabControl to another Panel. Is it possible to do so? If it's possible, how?

    Read the article

  • WPF Style Override breaks Validation Error event propagation

    - by Ben McMillan
    I have a custom control that overrides Window: public class Window : System.Windows.Window { static Window() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Window), new System.Windows.FrameworkPropertyMetadata(typeof(Window))); } ... } It also has a style: <Style TargetType="{x:Type Controls:Window}" BasedOn="{StaticResource {x:Type Window}}"> <Setter Property="WindowStyle" Value="None" /> <Setter Property="Padding" Value="5" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Controls:Window}"> ... Unfortunately, this breaks the propagation of the Validation.ErrorEvent for my window's contents. That is, my window can receive the event just fine, but I don't know what to do with it to mimic how a standard Window (or whoever) deals with it. If the validating controls are placed in a standard window, they work. They also work if I just take out the OverrideMetadata call (leaving them inside my custom window). Why is this happening, and how can I get the stock functionality for handling these validation error events working again? Thanks!

    Read the article

  • WPF opening up exe program within WPF window

    - by SwiftLion
    Not sure if this is possible but is there a way to open up another program like notepad within the container of a WPF window? similiar to that of being able to open a web page using the webbrowser control? Basically I would like to open notepad or other exe but keep it constrained within the WPF window container using xaml/c# code? not sure if possible?

    Read the article

  • wpf how to get all TextBoxes in wpf application

    - by GC87
    Hi, I'm trying to learn how to do proper wpf application and now I have a big trouble. I know how I would do this if I had to do it with Windows Forms, but I don't know how to modify it to fit with wpf. Would someone know the answer? Here is my code for Windows Forms Form_loaded event: foreach (Control ctrl in this.Controls) { if (ctrl is TextBox) { ctrl.Text = ""; } }

    Read the article

  • Disabling Minimize and Maximize buttons in a WPF Window

    - by marianor
    In WPF there is no possibility to control when the Minimize and Maximize buttons are disabled when the WindowStyle is SingleBorderWindow or ThreeDBorderWindow . In Windows Forms there are some properties like ControlBox , MinimizeBox and MaximizeBox that allow to do that. Because the WPF window internally has a hWnd we can do this using Windows API ( GetWindowLong and SetWindowLong will do the trick). I did three attached properties applicable to Window that use the internal API, in order to disable...(read more)

    Read the article

  • Best "For Pay" wpf controls

    - by Vaccano
    If this question has been asked then I applogize and I will join in voting to close it (or just delete it), but I could not find it being asked before. We are potentially embarking on making many of our apps using WPF. Most of our apps are normal business apps that will not need too much eye candy. Tasteful ui is nice, but I don't see us doing lost of custom animations and such. So, my question is what 3rd party control sets are the best ones to purchase to save you time in development of apps like this? (These should work with both Visual Studio 2008 and 2010.)

    Read the article

  • WPF - Make two controls the same size

    - by John Michaels
    Is there any way to make two controls that are in different containers the same size in WPF? For example, suppose you have two textboxes: textbox1 and textbox2. Textbox1 is in a grid and its size can grow and shrink when the user resizes the window. Textbox2 is in another part of the window and I need it to always have the same size as textbox1. Is there any way to do this? Keep in mind SharedSizeGroup will not work because the textboxes are in different containers. Also, I've tried binding textbox2's height property to textbox1 and that doesn't seem to work either. Finally, I tried catching textbox1's SizeChanged event, but its Height property is always NaN for some reason.

    Read the article

  • What is the WPF equivilant for the FlowLayoutPanel?

    - by Sargola
    I am working on a WPF application (a one note clone which is called "note your life") where you can dynamically assign Tags to an entry (just as in virtually any web 2.0 app these days). for this I had in my windows forms prototype a FlowLayoutPanel that did the job very well. I want to have the tags float to the next line if there isn't enough space and get a scrollbar if needed. how can this be achieved with WPF? I played around with <StackPanel Orientation="Horizontal" FlowDirection="LeftToRight" ...> but this doesn't move the elements in the next line if needed. Any suggestions?

    Read the article

  • forcing Validation; WPF, DataGrid, ObservableCollection

    - by Steve Mills
    I have a WPF DataGrid. I read a csv file and build an ObservableCollection of objects. I set the DataGrid.ItemsSource to the Collection. I would like to then force a RowValidation on every row in the DataGrid. If I, playing user, edit a cell, the RowValidation fires, all is well. But the Validation does not fire on the initial load. Is there some way I can call ??ValidateRow?? on a row? on every row? (C#, WPF, VS2008, etc)

    Read the article

  • WPF binding and pointers

    - by Eran
    hey guys, I have a WPF application that contains windows with few user controls and Coordinator object. the window and all its user controls pointing to an object, which instace is in the Coordinator, by thier DataContext. the problem is that I want to change this object (e.g. create new object()) in the Coordinator but I want all the dataContexts to point to the new object. I tried to send the object by ref to the window constructor but it didn't help. any idea about how can I rewrite the memory location that all pointers are pointing to? (I don't want to repalce the properties in object since its a lot of work nor to use a middle object that points to the replaced object) Thanks Eran

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >