Skip to content

Windows Forms

Desktop and Windows Forms development

This category can be followed from the open social web via the handle windows-forms@forum.codeproject.com

2.1k Topics 7.1k Posts
  • OpenFileDialog exceptions

    sysadmin debugging performance help tutorial
    10
    0 Votes
    10 Posts
    2 Views
    M
    That was a good clue! I disabled my network adapter to check if the network could cause the problem and the OpenFileDialog worked fine! As my "My Documents" folder is stored on a remonte server, my computer uses the network connection to get the folder and files informations. Any idea why this could throw the exceptions I have? I'm not sure yet why I have those exceptions, but my code isn't faulty! ;P
  • Visual Studio insists my form has changed

    help csharp visual-studio winforms design
    7
    0 Votes
    7 Posts
    3 Views
    W
    I have some custom controls and some forms that inherit from other forms. You might be on to something there.
  • dock a windows form into ppt application window

    tutorial
    2
    0 Votes
    2 Posts
    5 Views
    D
    If you're talking about a normal Windows Form application, you can't. PowerPoint will not repaint your window since it will know nothing about it. There is also no interface in PowerPoint to tell it about your window either. A guide to posting questions on CodeProject[^] Dave Kreskowiak
  • Windows::Forms::ListView Repaint-Bug

    graphics docker help question
    2
    0 Votes
    2 Posts
    3 Views
    M
    Have you tried handling the Layout event, instead of Resize? On the resize page, it is suggested that for a custom layout (of child elements), that Layout should be handled instead of resize. I'm guessing it might affect the repaint and re-positioning of the child controls, hopefully removing the bug. Control.Resize Event[^] Control.Layout event[^]
  • 0 Votes
    6 Posts
    4 Views
    B
    Thanks, Mehdi, I look forward to studying this; haven't found time yet to go back and start turning on and off Win 7 window styles and examining their various effects on DisplayRectangle, ClientRectangle, Bounds, etc. The last discussion forum item on that CodePlex project site[^] suggests to me there may be problems with that code on Win 7. But, I'll try it out, anyhow. best, Bill "Is it a fact - or have I dreamt it - that, by means of electricity, the world of matter has become a great nerve, vibrating thousands of miles in a breathless point of time? Rather, the round globe is a vast head, a brain, instinct with intelligence!" - Nathanial Hawthorne, House of the Seven Gables
  • Get rid of WaitCursor

    question
    20
    0 Votes
    20 Posts
    4 Views
    M
    I think you've run into a Windows quirk here. I've had this behaviour with other applications, and most of them weren't .NET. If the user is waiting for a while for the program to load/complete work, then it might be more elegant an idea to give more interface cues than just the wait cursor changing, such as a status text, or progress bar, etc.
  • windows front end

    database winforms help
    17
    0 Votes
    17 Posts
    2 Views
    L
    I would at least try with the good old controls that come with Visual Studio (whatever version) out of the box. They change appearance with Windows' visual settings. At least in Windows XP you can choose XP native look or classic Windows look. I guess, the same application would get a nice transparent frame on Vista and up. Ciao, luker
  • Deploying Reports

    question csharp winforms tutorial discussion
    2
    0 Votes
    2 Posts
    4 Views
    A
    I've worked with a few enterprise software packages that use Crystal Reports. The most common way to do it seems to be just like you've described... drop the report files in a Reports folder along with the other application files. From there, using a relative path combined with the execution path would be the most flexible. I've also seen a software system that allowed you to check-in/check-out reports from the database. Not only was this used to capture metadata about the reports but also to store them in a database instead of the standard file structure. I think it really boils down to whether or not you want the reports to be accessible (easily) or not and if you'll be having user functions within the app to manipulate the reports (e.g. adding new ones).
  • windows forms using active directory

    csharp question asp-net database sql-server
    4
    0 Votes
    4 Posts
    3 Views
    G
    The only real difference is where you get the current user info from for your authentication. In asp, I use this function (everyone stop laughing...I never got around to cleaning it up): public string Whoami() { string str; int idx; str = System.Web.HttpContext.Current.Request.LogonUserIdentity.Name; idx = str.IndexOf("\\"); return str.Substring(idx + 1); } But on the desktop, all you need is: string SAMS = System.Security.Principal.WindowsIdentity.GetCurrent().Name; Then diddle a little with it to get just the login: string[] SAM = SAMS.Split(Delim, StringSplitOptions.RemoveEmptyEntries); with SAM[1] being the login without the domain. After that, you can check AD to see if the user is authorized, or whatever. I thought you had to go to Pittsburgh for that. My Mu[sic] My Films My Windows Programs, etc.
  • Host a WPF form/application windows inside a Winform - how?

    question csharp wpf
    2
    0 Votes
    2 Posts
    3 Views
    S
    you can host WPF controls in a form Integrate WPF UserControls in WinForms[^]
  • Deploy Windows Application

    csharp visual-studio com announcement workspace
    5
    0 Votes
    5 Posts
    3 Views
    B
    This doesn't directly answer your question, but we used to deploy applications at our company like that, then we finally switched our deployment to ClickOnce. We have our internal software deployed on an XP Pro box, no bells and whistles, and it handles the deployment fine. You'll have to set up your IIS first, but if you do updates to alot of machines, it really is worth looking into. Good luck!
  • Windows7 hosts file is ignored

    com question
    3
    0 Votes
    3 Posts
    4 Views
    D
    Any changes should be seen immediately, however, you may have to flush any caches and reload the tables ipconfig /flushdns nbtstat -r from the command prompt. Dave Find Me On: Web|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
  • Copying last created file in a directory

    question
    7
    0 Votes
    7 Posts
    2 Views
    M
    Thank you Alan! That was very helpful.
  • Through one router only, will UDP package out of order?

    question
    5
    0 Votes
    5 Posts
    3 Views
    M
    At any rate, UDP won't guarantee you delivery of a packet, so out-of-order is not your only concern.
  • Recommendation for Charts control

    csharp wpf question announcement
    2
    0 Votes
    2 Posts
    3 Views
    R
    Microsoft acquired some Dundas code and released Microsoft Chart Controls. They are great when you think you are getting them for free. "You get that on the big jobs."
  • FileStreams

    tutorial question
    2
    0 Votes
    2 Posts
    2 Views
    S
    Google: .net filestream examples[^] Is a good place to start, but this link shows where you'd use the while loop Filestream and while loop[^] Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
  • 0 Votes
    3 Posts
    2 Views
    C
    I think it was a mix of not passing the PaintEventArgs Graphics, and not calling InitaliseComponent() on the child control, which doesn't help!
  • Plotting large amounts of data

    graphics performance help
    2
    0 Votes
    2 Posts
    3 Views
    B
    Hi, I am curious to ask you if you have come up with a strategy for your solution yet, and, have you considered doing this in WPF rather than WinForms. I think a critical factor here would the latency of time-to-display you, or the end-user, would be willing to tolerate. Can the end-user manipulate the size of the view-port ? You mention having "1000 pixels to plot them in:" I'm trying to infer from that number a possible size of view-port, and ... assuming 3 bytes per pixel for color information, or 4 for color + alpha ... I come up with a very small view-port: unless each virtual-pixel is 'magnified' into a chunk of many screen pixels. A final question: can you assume that you are dealing with a 'static' data-set here, or, are you getting real-time changes ? The discussion here[^] may give you some ideas for strategy. My guess is you are going to need 'unsafe' access to the 'raw' bytes. ... edit 1 ... Can you assume the consumer of your application has a certain amount of memory available ? The discussion here[^] (particularly the comments by MusiGeneis and Hans Passant) may be useful to understand some 'misleading' aspects of the GDI+ "out of memory" Exception, and Passant's answer provides a useful Enum of GDI+ error codes you can use. ... end edit 1 ... best, Bill "Reason is the natural order of truth; but imagination is the organ of meaning." C.S. Lewis modified on Monday, July 18, 2011 3:05 AM
  • Twin TreeView

    data-structures xml tutorial question
    8
    0 Votes
    8 Posts
    3 Views
    G
    Thanks, Bill Ger
  • 0 Votes
    1 Posts
    1 Views
    No one has replied