Search Results

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

Page 74/143 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • Call Dispose() on a WindowsIdentity object? C#

    - by Andy
    I am retrieving a WindowsIdentity object by calling: win_id = System.Security.Principal.WindowsIdentity.GetCurrent(); with the intention of getting the currently logged on user name, which works fine. WindowsIdentity implements IDisposable, but since I din't create the object myself, do I still need to call .Dispose() on it when I am finished with it or not? Thanks.

    Read the article

  • Get label height for fixed width

    - by Jonas
    Is there any way I can get the height of a label, if it hypothetically had a certain width? I've been trying with control.GetPreferredSize(size) like so: Dim wantedWidth as Integer = 100 dim ctrlSize as Size = label.GetPreferredSize(new Size(wantedWidth, 0)) because I thought that setting height = 0, would indicate a free height, but the height I get is way too small. I also tried to estimate the height of the label, using Graphics.MeasureString to calculate the equivalent area of the Label dim prefWidth as Integer = 100 dim estSize as SizeF = g.MeasureString(label.Text, label.Font) dim estHeight as Integer = (Integer)(estSize.Width * estSize.Height / prefWidth) but that yields the same result. Any ideas? I'm on .NET 2.0, unfortunately.

    Read the article

  • Err Web Service?

    - by j-t-s
    Hi All I am trying to implement a feature. But I've never had anything to do with "Web Services" before, other than using them. I have a desktop application, and I want that application to be able to sort of "post" some information (i.e. email address, username, user-selected options (just plain text) etc) to an application or "web service" on my ASP.NET web server. Can somebody please guide me in the right direction? How would I accomplish this? Thank you :) Jason

    Read the article

  • Re-Inventing The Label Control

    - by j-t-s
    Hi All, I need to reinvent/recreate the Label Control from scratch to add my own mojoness to it. Yes, I know what you're thinking (and if you're not thinking that, shouldn't you be?). Can somebody point me in the right direction? Thank you.

    Read the article

  • doublebuffering not reducing the flicker

    - by fishhead
    I am drawing an grid-work of objects in a Panel. when I scroll the the panel quickly I get a flicker. I thought that enabling the double buffering may take care of this but what I find is that it does not completely draw everything and I am left with blank sections. could anyone give me suggestions as to what may be happening and how I might correct it. UPDATE: I found that I was creating the graphics object with Creategraphics() rather than using the Parameter in the paint method

    Read the article

  • Newline not showing correctly in textbox

    - by TheGateKeeper
    I am loading a string from my database which among other things contains line breaks (\r\n). However, this isn't being rendered as a new line but instead as \r\n. If I type it directly in instead of loading it from a string, it works just fine but I need to be able to load it from a string. Any ideas? Edit: Upon closer inspection, it looks like the string is being returned as: Changed test7\\r\\nChanged test8\\r\\nChanged test9Changed test7 From the database. I tried running a .Replace(@"\\", @"\") on it but this had no effect at all. Any ideas?

    Read the article

  • ASP.Net WebSite Membership AND C# Windows Form Membership

    - by user1638362
    This is not real, it's just a project i'm working on I've created a Hotel Management system in C# WindowsForm, it allows staff members to Add/Edit/Update Rooms,Reservation and Customers etc. Along side this Windows-form i'm creating an ASP.net WebSite where customers should be able to register and reserve rooms online. I've come to the point where i need to create some-type of membership method for this website which should correspond to the membership of the windows form. However i'm not sure what method of membership would be best suited for this, i have looked into the asp.net membership, it's what i want however it creates it's own schema and i don't know how i can relate the information to my customers table and c#windows form. I would ideally like it to resemble a real-life situation as much as possible anyway, am i going about this the wrong way? in terms of the c# windows-form what other technology would a business use to manage a system like this where they can add/edit/update there system and have a website which relates. What are my options here?

    Read the article

  • Windows Forms application C# | Sending Tweet

    - by Andrew Craswell
    I've been able to get my Twitter web app working just fine, but I've recently decided to add Tweeting functionality from a Windows Form, but I'm having no luck sending tweets. No errors are thrown or anything. Mind looking over my code? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using TweetSharp; namespace TwitterAdvirtiser { public partial class Form1 : Form { private string cKey = "xxx"; private string cSecret = "xxx"; private string oToken = "xxx"; private string aToken = "xxx"; public Form1() { InitializeComponent(); OnStart(); } private void OnStart() { //Authenticate with Twitter TwitterService service = new TwitterService(cKey, cSecret); service.AuthenticateWith(oToken, aToken); service.SendTweet("testing"); } } } It seems like I'm authenticating just fine, I can walk through debug mode and see all my details in the TwitterUser structure, and yet my tweets never show up on my feed. Whats up? By the way, I'm using Visual Studios 2010, and .NET 4.0. I have verified that the oToken and aToken strings have my developer tokens.

    Read the article

  • Labelsize appears bigger in VB.Net

    - by Ikke
    I'm trying to stack a few lists on top of each other. But the label.size.height appears to be bigger then the label itself. When i set the borderstyle to fixedsingle, i see the border around the text. But the height is bigger, so there comes a space between one label and the next. I have tried to set margin and padding to 0 without result. Exemple: label.size.height return 23, when the height actually is something around 15. Does someone knows how i get the right size? Edit: When i explicitly set the height of the lable, the problem is solved. Is this some problem with autosize?

    Read the article

  • How To Bind ComboBox With ListItems in windows Forms?

    - by hatem gamil
    hi all i want to make a 2 comboBoxes ,the first one shows Hours and the Second Shows minutes but i cant do so in windows application as i have working as a web dev for a while and i forgot so i want to declare listItems then bind it to combo box i want to make it as a custom control so i want some help to tell me how to do that i am using VS 2008 thnxx

    Read the article

  • Get the currently focused textbox in C#

    - by chown
    I have two textboxes, and a button. When I press the button, I want to know where my current caret is (either of the two boxes). I need this to know where to insert a certain text. I tried textbox1.Focused; textbox1.enabled but neither worked. How should I implement this? Thanks

    Read the article

  • Is there such a thing as a dektop application event aggregator, similar to that used in Prism?

    - by brownj
    The event aggregator in Prism is great, and allows loosely coupled communication between modules within a composite application. Does such a thing exist that allows the same thing to happen between standalone applications running on a user's desktop? I could imagine developing a solution that uses WCF with TCP binding and running inside Windows Process Activation Service. Client applications could subscribe or publish events to this service as required and it would ensure all other listeners get notified of events as appropriate. Using TCP would enable event messages to be pushed out to clients without the need for polling, ensuring messages are delivered very quickly. I can't help but think though that such a thing would already exist... Is anyone aware of something like this, or have any advice on how it may be best implemented?

    Read the article

  • Creating Settings form using TreeView in C#

    - by Kiran Chandrashekhar
    I am developing the settings form for the software developed in C#. I was looking at how different software have implemented their settings form. In most of the cases that I came across, they seem to be using Treeview on the left pane of the form and configuration settings on the right pane. Ref URL : http://2.bp.blogspot.com/-nMfQoLurxwM/UDXfiZKd4DI/AAAAAAAAAME/IRf6kmxay4w/s1600/bild1.jpg I was wondering, how the different controls are designed/displayed on the right pane. Do they hide all the controls depending which node is selected in the TreeView something like this : if (treeView1.SelectedNode == treeView1.Nodes[0]) { this.groupBox1.Visible = true; this.button1.Visible = true; this.textBox1.Visible = true; this.textBox2.Visible = true; this.label1.Visible = true; this.label2.Visible = true; this.label3.Visible = true; } else { this.groupBox1.Visible = false; this.button1.Visible = false; this.textBox1.Visible = false; this.textBox2.Visible = false; this.label1.Visible = false; this.label2.Visible = false; this.label3.Visible = false; this.groupBox2.Visible = true; this.button2.Visible = true; this.textBox3.Visible = true; this.textBox3.Visible = true; this.labe4.Visible = true; this.label5.Visible = true; this.label6.Visible = true; // bool success = selectColor(); } Is my understanding correct ? Or do we have a better design approach for creating a settings form. Thanks

    Read the article

  • Catching exception in Main() method

    - by Corvin
    Consider the following simple application: a windows form created by a "new C# windows application" sequence in VS that was modified in a following way: public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Application.Run(new Form1()); } catch (Exception ex) { MessageBox.Show("An unexpected exception was caught."); } } Form1.cs contains the following modifications: private void Form1_Load(object sender, EventArgs e) { throw new Exception("Error"); } If I press F5 in IDE, then, as I expect, I see a message box saying that exception was caught and the application quits. If I go to Debug(or Release)/bin and launch the executable, I see the standard "Unhandled exception" window, meaning that my exception handler doesn't work. Obviously, that has something to do with exception being thrown from a different thread that Application.Run is called from. But the question remains - why the behavior differs depending on whether the application has been run from IDE or from command line? What is the best practice to ensure that no exceptions remain unhandled in the application?

    Read the article

  • Any way to create a hidden main window in C#?

    - by Bill
    I just want a c# application with a hidden main window that will process and respond to window messages. I can create a form without showing it, and can then call Application.Run() without passing in a form, but how can I hook the created form into the message loop? Is there another way to go about this? Thanks in advance for any tips!

    Read the article

  • Bring another processes Window to foreground when it has ShowInTaskbar = false

    - by Mongus Pong
    We only want one instance of our app running at any one time. So on start up it looks to see if the app is running and if it is, it calls SetForegroundWindow on the Main Window. This is all good and well ... for the most part.. When our app starts up it will show a Splash screen and a Logon form. Both of these forms have ShowInTaskBar = false. Because of this, if you try to start up another copy of the app when the Logon form is showing, that Logon form is not brought to the front! Especially as the user cant see anything in the taskbar as well, all they figure is that the app is duff and cannot start. There is no indication that there is another instance running. Is there any way around this problem?

    Read the article

  • 2 or more Controls only 1 is considered Active

    - by Don
    I have 2 controls (MyCtrl) next to each other called ctrlLeft and ctrlRight. Whenever one receives interaction it is considered active (by default the left one). I override OnDraw and customize the look of the active one a bit. Currently I have a property Active and an event that I subscribe to from all MyCtrl in there I store a reference to the active one like this: if (sender is MyCtrl) { ctrlActive = (sender as MyCtrl); ctrlLeft.Active = !(ctrlRight.Active = (ctrlActive == ctrlRight)); } Either way I need to have ctrlActive as I use it for other things but what I am wondering is if this is the best way make them aware of each other? Another option I thought of was to store references to every possible MyCtrl and then loop through em all and activate / deactivate the one that match sender just in case I in the future add a ctrlMiddle. Are my thoughts wrong, is there better options to do this. For example, how does radiobuttons accomplish their similar functionality?

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >