Search Results

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

Page 107/113 | < Previous Page | 103 104 105 106 107 108 109 110 111 112 113  | Next Page >

  • .NET WebBrowser control with Adobe SVG Viewer

    I'm having problems with SVG files loading in a .NET 2.0 WebBrowser control. If I create a new WinForms application project, drag a WebBrowser control and a button onto the Form1.cs design surface, and add a line to the button's on-click handler to set the Url property of the WebBrowser control to an SVG file, I get two IE script errors at runtime (as in, the dialog you get when there is a Javascript problem). The only line of code I'm writing is therefore: webBrowser1.Url = new Uri(@"http://wiki.allegro.cc/pub/f/fb/Grozilla.svg"); This SVG file loads fine if I browse directly to the link with IE; the errors I get via my test app are: line 2, char 1, error: Invalid character, followed by line 1, char 1, error: Object expected (assuming I answer yes to the prompt to 'continue running scripts on this page'). I'm using IE 7.0.5730.13, Adobe SVG Viewer 3.03 build 94, Visual Studio 2008. Can anyone replicate this? Has anyone seen it/got any idea how to fix it? (edit: previously setting the URL in the constructor for the purposes of the example, but this raised the question of whether or not the control had finished initialising, so have changed the example to use a button - the problem still occurs. This bug originally appeared in production code so the example program I wrote was an attempt to isolate the issue and reproduce it as simply as possible.) (edit 2: having tested on several different machines, this problems seems to be related to IE7 - run IE6, and everything works fine.)

    Read the article

  • Subsonic in a VS2008 Add-In woes

    - by Michael Smit
    Hi, I am writing a VS2008 add-in that connects to a remote database blah blah. I am having a problem with the app.config in this project. When I use SubSonic in my code, it moans that is cannot find the SubSonicServer section. This is because the .config file cannot be found. This appears to a problem with paths as the add-in is a DLL running in the context of VS2008 and the working directory is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE. Is there a way to get the app.config to deploy properly with the application so my add-in (and SubSonic) can find what it needs in the .config file, or is there a way to get SubSonic to work without the need for the .config? I am very experienced in SubSonic projects now, but only winforms, web, web service, and WPF applications. This is the first time I have tried to use SubSonic in a VS2008 Add-In project. I also have AppSettings in the config file which the ConfigurationManager cannot read because it cannot see the .config file. 2AM now and brain is tired of trying to figure this one out. Hopefully there is an answer when I wake up :) TIA

    Read the article

  • Handling learning curve for new developers

    - by pete the pagan-gerbil
    Our company likes to hire new developers, with no experience. We have a core set of skills that we try to get them up to speed with, like ASP.NET and WinForms - to teach basic programming, the .NET languages, and the things they'll need to maintain and write. We also try and mentor them through early projects, so they can learn from someone more experienced. Recently, we've been seeing the benefits of new frameworks like MVC and ideas like Unit Testing and TDD (by extension, dependancy injection and IoC), and we'd like to start using these in the team. However, this increases the time that a junior would have before they can get started on a new project - because doing something like unit tests wrong could cause major headaches months or years later in maintenance, especially if we believe unit tests to be comprehensive. How do you handle the huge amount of things that a junior will need to take on, acknowledging that the business wants them working independantly as soon as possible? Is it acceptable to tell them not to unit test till a while after they are independant (and give them small, simpler projects in the meantime) before taking them to 'level 2' of the core skills?

    Read the article

  • Setting directory security to allow user and deny all

    - by Rita
    I have winforms app, in which I need to access a secured directory. I'm using impersonation and create WindowsIdentity to access the folder. My problem is writing unit tests to test the directory security; I'd like to a write a code that creates a directory secured to only ONE user, which isn't the current user running the UT (or else the test would be worthless). I know how to add permissions to a certain user, but how can I deny the rest, including admins? (in case the user running the UT is an admin) (will this be a wise thing to do?) DirectoryInfo directoryInfo = new DirectoryInfo(path); DirectorySecurity directorySecurity = directoryInfo.GetAccessControl(); directorySecurity.AddAccessRule(new FileSystemAccessRule("Domain\SecuredUser", FileSystemRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AccessControlType.Allow)); directorySecurity.RemoveAccessRule(new FileSystemAccessRule("??", FileSystemRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AccessControlType.Deny)); directoryInfo.SetAccessControl(directorySecurity); This isn't working. I don't know who am I supposed to deny. Domain\Admins, Domain\Administrators, me... No one is being denied, and when I check folder's security - The SecuredUser has access to the folder, but the permissions are not checked, even though I specified FullControl. Basically I want to code this: <authorization> <allow users ="Domain\User" /> <deny users="*" /> </authorization> I was thinking about impersonating UT run with a weak user with no permissions, but this would result in: Impersonate - Run UT - Impersonate - Access folder, and I'm not sure if this is the right design. Help would be greatly appreciated, thank you.

    Read the article

  • Moving .NET assemblies away from the application base directory?

    - by RasmusKL
    I have a WinForms application with a bunch of third party references. This makes the output folder quite messy. I'd like to place the compiled / referenced dlls into a common subdirectory in the output folder, bin / lib - whatever - and just have the executables (+ needed configs etc) reside in the output folder. After some searching I ran into assembly probing (http://msdn.microsoft.com/en-us/library/4191fzwb.aspx) - and verified that if I set this up and manually move the assemblies my application will still work if they are stored in the designated subdirectory like so: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="bin" /> </assemblyBinding> </runtime> </configuration> However, this doesn't solve the build part - is there any way to specify where referenced assemblies and compiled library assemblies go? Only solutions I can think of off the top of my head is either post-build actions or dropping the idea and using ILMerge or something. There has got to be a better way of defining the structure :-)

    Read the article

  • Image resizing - sometimes very poor quality?!

    - by eWolf
    I'm resizing some images to the screen resolution of the user; if the aspect ratio is wrong, the image should be cut. My code looks like this: protected void ConvertToBitmap(string filename) { var origImg = System.Drawing.Image.FromFile(filename); var widthDivisor = (double)origImg.Width / (double)System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; var heightDivisor = (double)origImg.Height / (double)System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; int newWidth, newHeight; if (widthDivisor < heightDivisor) { newWidth = (int)((double)origImg.Width / widthDivisor); newHeight = (int)((double)origImg.Height / widthDivisor); } else { newWidth = (int)((double)origImg.Width / heightDivisor); newHeight = (int)((double)origImg.Height / heightDivisor); } var newImg = origImg.GetThumbnailImage(newWidth, newHeight, null, IntPtr.Zero); newImg.Save(this.GetBitmapPath(filename), System.Drawing.Imaging.ImageFormat.Bmp); } In most cases, this works fine. But for some images, the result has an extremely poor quality. It looks like the would have been resized to something very small (thumbnail size) and enlarged again.. But the resolution of the image is correct. What can I do? Example orig image: Example resized image: Note: I have a WPF application but I use the WinForms function for resizing because it's easier and because I already need a reference to System.Windows.Forms for a tray icon.

    Read the article

  • How to configure database connection securely

    - by chiccodoro
    Similar but not the same: How to securely store database connection details Securely connecting to database within a application Hi all, I have a C# WinForms application connecting to a database server. The database connection string, including a generic user/pass, is placed in a NHibernate configuration file, which lies in the same directory as the exe file. Now I have this issue: The user that runs the application should not get to know the username/password of the general database user because I don't want him to rummage around in the database directly. Alternatively I could hardcode the connection string, which is bad because the administrator must be able to change it if the database is moved or if he wants to switch between dev/test/prod environments. So long I've found three possibilities: The first referenced question was generally answered by making the file only readable for the user that runs the application. But that's not not enough in my case (the user running the application is a person. The database user/pass are general and shouldn't even be accessible by the person.) The first answer additionally proposed to encrypt the connection data before writing it to the file. With this approach, the administrator is not able anymore to configure the connection string because he cannot encrypt it by hand. The second referenced question provides an approach for this very scenario but it seems very complicated. My questions to you: This is a very general issue, so isn't there any general "how-to-do-it" way, somehow a "design pattern"? Is there some support in .NET's config infrastructure? (optional, maybe out of scope) Can I combine that easily with the NHibernate configuration mechanism?

    Read the article

  • VS 2008 created shortcut doesn't show up in "Send To" menu

    - by Brettski
    I have a WinForms application built using Visual Studio 2008. I added a Setup Project to the solution to create an installation MSI file. I need the setup project to create a shortcut pointing to the application's executable in the users Send To Menu. This way when someone right clicks on a file, my application will show in the Send To list and be selected. I figured out under the file system settings of the Setup project how to add a shortcut to the Users Send To Menu. The problem is, the shortcut doesn't show in the Send To menu when you right click on a file. If I manually create a shortcut to my executable the application does show in the Send To menu. I have read many suggestions on the web to required registry entries for this to work. There is a VBS file written by Ramesh Srinivasan which inserts them. On every system I have tried this on the registry values already existed, so this is not the problem. It seems more to be with the shortcut Visual Studio (or the msi anyway) is creating.

    Read the article

  • Does a VCL OrgChart component with decent features exists? Is there a viable alternative?

    - by user193655
    I am using DevExpress OrgChart component that is still maintained but not developed since 2003 (fortunately bugs are fixed, but nothing more). Honestly this component, even if it starts to look too old still suffices my requirements except for 2 things: 1) it doesn't support at all the staff feature, for understanding what I mean see this image (where the items in staff are Administration, Communication, IT, Special Projects). 2) it arranges the items without optimizing the space, for example if there are 3 items at top level, and only the second item has 2 childs, the top items items are drawn more distantly, because of the 2 childs, there is no an option for "shirinking" the diagram. Of course the component misses tons of the features one would expect from an OrgChart tool, but in my case Those 2, and expecially (1) are important, the rest is lack of eye-candy. I look for VCL components, but if (as I fear, since I never found it) such component doesn't exist) I can see the following alternatives: i) using Hydra with .net winforms components ii) using ActiveX components. Between the 2 I would prefer ActiveX because of the .NET deployment hell (what I like about Delphi is that you ship the exe to the customer witn Win2k and it works). Anyway I never used an activeX control and I don't know which are the deployment issues, but I fear I will lose the opportunity of replacing an exe and upgrading the software. iii) hire a delphi component develoeper that can customize the DevEx component by adding feature (1) and maybe (2). I am stuck.

    Read the article

  • Method of transforming 3D vectors with a matrix

    - by Drew Noakes
    I've been doing some reading on transforming Vector3 with matrices, and am tossing up digging deeper into the math and coding this myself versus using existing code. For whatever reason my school curriculum never included matrices, so I'm filling a gap in my knowledge. Thankfully I only need a few simple things, I think. Context is that I'm programming a robot for the RoboCup 3D league. I'm coding it in C# but it'll have to run on Mono. Ideally I wouldn't use any existing graphics libraries for this (WinForms/WPF/XNA) as all I really need is a neat subset of matrix transformations. Specifically, I need translation and x/y/z rotations, and a way of combining multiple transformations into a single matrix. This will then be applied to my own Vector3 type to produce the transformed Vector3. I've read different advice about this. For example, some model the transformation with a 4x3 matrix, others with a 4x4 matrix. Also, some examples show that you need a forth value for the vector's matrix of 1. What happens to this value when it's included in the output? [1 0 0 0] [x y z 1] * [0 1 0 0] = [a b c d] [0 0 1 0] [2 4 6 1] The parts I'm missing are: What sizes my matrices should be Compositing transformations by multiplying the transformation matrices together Transforming 3D vectors with the resulting matrix As I mostly just want to get this running, any psuedo-code would be great. Information about what matrix values perform what transformations is quite clearly defined on many pages, so need not be discussed here unless you're very keen :)

    Read the article

  • Poor DB4O performance - What am I doing wrong?

    - by Jon
    I read Rob Conery's post about Object databases and thought I'd give it a go. I have a class lets say Book with 15 properties mostly string, some int, one Datetime and 2 decimals. I used Rob's code to open the database file etc to test on a Winforms project not a Web project. So I did the following: for(int i = 0; i < 1000000; i++) { var Book = new Book(); //Assign variables s.Save(Book); } s.CommitChanges(); This took at least a couple of minutes. I then tried to retrieve all data to test speed: var spp = s.All<Passports>(); This one line was quick, however, then doing: sppp.Count() as well as a seperate test doing a foreach loop and incrementing a counter took a couple of minutes. This seems quite slow to me. Am I doing something wrong or am I expecting too much?

    Read the article

  • InfoPath FormControl on STA worker thread

    - by Rob Ford
    I have a .NET class that exposes two public methods: one to create an InfoPath form and another to Export to one of the supported formats. I’m using the Microsoft FormControl to do this. It’s hosted by a Form that does not get displayed. I get called by a Winforms app, but on an MTA worker thread instead of the UI thread. So I create an STA thread and execute on that, which works exactly once and then results in this exception: System.InvalidOperationException was unhandled Message="Unable to get the window handle for the 'FormControl' control. Windowless ActiveX controls are not supported." Source="System.Windows.Forms" StackTrace: at System.Windows.Forms.AxHost.EnsureWindowPresent() at System.Windows.Forms.AxHost.InPlaceActivate() at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state) at System.Windows.Forms.AxHost.CreateHandle() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.AxHost.EndInit() at InfoPathCreateStaThreadTest.FormControlHost.InitializeComponent() in C:\Windows\Temp\InfoPathCreateStaThreadTest\InfoPathCreateStaThreadTest\FormControlHost.Designer.cs:line 65 After some experimenting, I started to suspect this is a message pumping problem. I then came across this, which makes me more strongly suspect so: http://blogs.msdn.com/cbrumme/archive/2004/02/02/66219.aspx I tried various methods of pumping messages with no luck. I should mention that the alternative of automating the InfoPath app is not viable unless I can figure out how to hide the app. Any help would be much appreciated.

    Read the article

  • How to exit grid with ctrl-TAB when grid is on a tabpage (onkeydown works when grid not on tabpage)

    - by Charles Hankey
    winforms .net 3.5 Ultrawingrid 9.2 In my subclass of Ultrawingrid.Ultragrid : Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs) If e.KeyCode = Windows.Forms.Keys.Tab andalso e.control = True then SetFocusToNextControl(True) End if Mybase.OnKeyDown(e) End Sub This works fine. But when the grid is dropped on a TabControl tabpage, the ctrl-tab looks very different to the sub above. e.keycode is seen as controlkey {17} I realize that by default cntrl-Tab moves between tabpages. I need to override this behavior. My thought is I probably need a subclass of the tabControl which will pass the keycombo through just as the form does but I confess to being clueless as to how to accomplish that. I tried to override the onkeydown of a tabcontrol subclass and just issuing a return and not and base call to onkeydown if the ctrl-tab combo was pressed but it seemed to see the e.keycode as controlkey as well. FWIW I tried a different combination like ctrl-E and got pretty much the same result with focus disappearing from the grid but not going anywhere I could detect. The sub still saw the e.control as controlkey. Oddly, ctrl-X, ctrl-A etc all work in the grid and a ctrl-Delete combo I put in the subclass for deleting a row works fine. Once again - grid directly on form and it all works. I'm definitely over my head on this one. Guidance much appreciated. vb or c# fine. TIA

    Read the article

  • Opening a pdf in .NET

    - by link664
    In the application we are working on we are trying to implement Help. We have a help pdf document and for the moment it has been deemed acceptable that when users click the help button it just opens the pdf. The application is a desktop app and the pdf file needs to be included in the install somehow and installed on the local machine. I essentially need two things: How would I add this pdf to the application so that it is available on the client machine after install? I can either put it in the resources of the project, or else I could put it in the Application Folder of the client setup installer. How would I open this pdf? I can either open this pdf by just launching the default pdf viewer for the file, or I can use the System.WinForms.WebBrowser tool to display it. However if I choose the second option, I am unsure of how to access the file stored in the resources or find it in the install folder. If you could please provide me with the code to do this (either in VB.Net or C#.Net) that would be great.

    Read the article

  • Drag and Drop in Silverlight with F# and Asynchronous Workflows

    - by knotig
    Hello everyone! I'm trying to implement drag and drop in Silverlight using F# and asynchronous workflows. I'm simply trying to drag around a rectangle on the canvas, using two loops for the the two states (waiting and dragging), an idea I got from Tomas Petricek's book "Real-world Functional Programming", but I ran into a problem: Unlike WPF or WinForms, Silverlight's MouseEventArgs do not carry information about the button state, so I can't return from the drag-loop by checking if the left mouse button is no longer pressed. I only managed to solve this by introducing a mutable flag. Would anyone have a solution for this, that does not involve mutable state? Here's the relevant code part (please excuse the sloppy dragging code, which snaps the rectangle to the mouse pointer): type MainPage() as this = inherit UserControl() do Application.LoadComponent(this, new System.Uri("/SilverlightApplication1;component/Page.xaml", System.UriKind.Relative)) let layoutRoot : Canvas = downcast this.FindName("LayoutRoot") let rectangle1 : Rectangle = downcast this.FindName("Rectangle1") let mutable isDragged = false do rectangle1.MouseLeftButtonUp.Add(fun _ -> isDragged <- false) let rec drag() = async { let! args = layoutRoot.MouseMove |> Async.AwaitEvent if (isDragged) then Canvas.SetLeft(rectangle1, args.GetPosition(layoutRoot).X) Canvas.SetTop(rectangle1, args.GetPosition(layoutRoot).Y) return! drag() else return() } let wait() = async { while true do let! args = Async.AwaitEvent rectangle1.MouseLeftButtonDown isDragged <- true do! drag() } Async.StartImmediate(wait()) () Thank you very much for your time!

    Read the article

  • Should I use MEF or Prism for my Silverlight project?

    - by Daniel
    Hi! My team(3 developers) will be building a Silverlight LOB application. This is the first Silverlight project for us. We've been doing mostly Winforms. We'll be using Silverlight4 / VS2010 / possibly WCF RIA Services, and ASP.NET Web application to handle authentication and host the silverlight pages. We need a way to.. Modularize the silverlight project so we can work in different parts of the application, then integrate them. Dynamically load different parts of the application, so the initial download size of the xap file wouldn't be too large. After some research, I found out that Prism and MEF are possible solutions to these goals. Can you give me advice on which framework to use? or possibly another solution? We don't have much experience on Silverlight and the project needs to be finished in 3 months, so the learning curves for frameworks should be considered. Thank you for reading! Any inputs will be much appreciated.

    Read the article

  • c# sending sms from computer

    - by I__
    i have this code: private SerialPort port = new SerialPort("COM1", 115200, Parity.None, 8, StopBits.One); Console.WriteLine("Incoming Data:"); port.WriteTimeout = 5000; port.ReadTimeout = 5000; // Attach a method to be called when there is data waiting in the port's buffer port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); // Begin communications port.Open(); #region PhoneSMSSetup port.Write("AT+CMGF=1\r\n"); Thread.Sleep(500); port.Write("AT+CNMI=2,2\r\n"); Thread.Sleep(500); port.Write("AT+CSCA=\"+4790002100\"\r\n"); Thread.Sleep(500); #endregion // Enter an application loop which keeps this thread alive Application.Run(); i got it from here: http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_22832563.html i have a new winforms empty application: 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; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } } } can you please tell me: where exactly would i paste the code? how do i get the code to run? i am sending AT COMMANDS to my cell phone that is attached to the computer

    Read the article

  • C# - Take Screenshot based on a Timer

    - by APShredder
    Hello everybody. I'm trying to create a WinForms app that takes a screenshot on a set interval. I think my code is correct, but when I try to run it, I get the error message "System.Runtime.InteropServices.ExternalException was unhandled, A generic error occurred in GDI+." System.Windows.Forms.Timer t = new System.Windows.Forms.Timer(); Thread th; private static Bitmap bmpScreenshot; private static Graphics gfxScreenshot; void TakeScreenShot() { bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb); gfxScreenshot = Graphics.FromImage(bmpScreenshot); gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy); bmpScreenshot.Save(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\ScreenCaptures", ImageFormat.Png); th.Abort(); } void StartThread(object sender, EventArgs e) { th = new Thread(new ThreadStart(TakeScreenShot)); th.Start(); } private void Form1_Load(object sender, EventArgs e) { Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\ScreenCaptures"); t.Interval = 500; t.Tick += new EventHandler(StartThread); t.Start(); } The line that's giving my trouble is: bmpScreenshot.Save(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\ScreenCaptures", ImageFormat.Png); Any ideas about what is going wrong? Thanks in advance.

    Read the article

  • How to choose light version of database system

    - by adopilot
    I am starting one POS (Point of sale) project. Targeting system is going to be written in C# .NET 2 WinForms and as main database server We are going to use MS-SQL Server. As we have a lot of POS devices in chain for one store I will love to have backend local data base system on each POS device. Scenario are following: When main server goes down!! POS application should continue working "off-line" with local database, until connection to main server come up again. Now I am in dilemma which local database is going to be most adoptable for me. Here is some notes for helping me point me in right direction: To be Light "My POS devices art usually old and suffering with performances" To be Free "I have a lot of devices and I do not wont additional cost beside main SQL serer" One day Ill love to try all that port on Mono and Linux OS. Here is what I've researched so far: Simple XML "Light but I am afraid of performance, My main table of items is average of 10K records" SQL-Express "I am afraid that my POS devices is poor with hardware for SQLExpress, and also hard to install on each device and configure" Less known Advantage Database Server have free distribution of offline ADT system. DBF with extended Library,"Respect for good old DBFs but that era is behind Me with clipper and DBFs" MS Access Sqlite "Mostly like for now, but I am afraid how it is going to pair with MS SQL do they have same Data types". I know that in this SO is a lot of subjective data, but at least can someone recommended some others lite database system, or things that I shod most take attention before I choice database.

    Read the article

  • Switching to WPF, the best use of time at Visual Studio Launch 2010

    - by Stewbob
    Yes, this is a programming-related question, if a little indirectly (that's why I marked it Community Wiki right away). For better or worse, I am switching from Winforms to WPF in April. I am also going to be in attendance at the Visual Studio Launch in Las Vegas. I have a real need to get up to speed quickly in WPF, so my question is: What sessions are going to be the best use of my time? I've got some picked out already, but I'm looking for some more advice on how to wade through all the marketing fluff and get some real educational value out of these few days. I have not been to one of these events before, so I don't really know how much is marketing hype, and how much is solid content. A couple of the workshops look interesting (VPR02 and VPS02), but I don't know enough about the actual content of these to justify the extra expense right now. Any thoughts there would be appreciated. And yes, I do have WPF learning planned other than just these few days in Vegas, but since I'm going to be there anyway, I want to learn as much as I can in the time available.

    Read the article

  • How to get an enum value from an assembly using late binding in C#

    - by tetranz
    Hello I have a C# 3.0 WinForms application which is occasionally required to control Excel with automation. This is working nicely with normal early binding but I've had some problems when people don't have Excel installed but still want to use my app except for the Excel part. Late binding seems to be a solution to this. Late binding is rather tedious in C# 3 but I'm not doing anything particularly difficult. I'm following http://support.microsoft.com/kb/302902 as a starter and it's working out well. My question is how can I use an enum by name? e.g, how can I use reflection to get the value of Microsoft.Office.Interop.Excel.XlFileFormat.xlTextWindows so that I can use it an InvokeMethod call? I know the easiest way is probably to create my own local enum with the same "magic" integer value but it would be nicer to be able to access it by name. The docs often don't list the value so to get it I probably need to have a little early bound test app that can tell me the value. Thanks

    Read the article

  • Where is the Open Source alternative to WPF?

    - by Evan Plaice
    If we've learned anything from HTML/CSS it's that, declarative languages (like XML) work best to describe User Interfaces because: It's easy to build code preprocessors that can template the code effectively. The code is in a well defined well structured (ideally) format so it's easy to parse. The technology to effectively parse or crawl an XML based source file already exists. The UIs scripted code becomes much simpler and easier to understand. It simple enough that designers are able to design the interface themselves. Programmers suck at creating UIs so it should be made easy enough for designers. I recently took a look at the meat of a WPF application (ie. the XAML) and it looks surprisingly familiar to the declarative language style used in HTML. It's blindingly apparent to me that the current state of desktop UI development is largely fractionalized, otherwise there wouldn't be so much duplicated effort in the domain of user interfaces (IE. GTK, XUL, Qt, Winforms, WPF, etc). There are 45 GUI platforms for Python alone It's painfully obvious to me that there should be a general purpose, open source, standardized, platform independent, markup language for designing desktop GUIs. Much like what the W3C made HTML/CSS into. WPF, or more specifically XAML seems like a pretty likely step in the right direction. Why hasn't anyone in the Open Source community (AFAIK) even scratched the surface of this issue. Now that the 'browser wars' are over should we look forward to a future of 'desktop gui wars?' Note: This topic is relatively subjective in the attempt to be 'future-thinking.' I think that desktop GUI development in its current state sucks ((really)hard) and, even though WPF is still in it's infancy, it presents a likely solution to the problem. Has no one in the OS community looked into developing something similar because they don't see the value, or because it's not worth the effort?

    Read the article

  • log4net - why would the same MyLog.Debug line not work at one point of startup, but work at another

    - by Greg
    Hi, During startup of my WinForms application I'm noting that there are a couple of points (before the MainForm renders) that do a "MyDataSet.GetInstance()". For the first one the MyLog.Debug line comes through in the VS2008 output window, but for a later one it does work and come through. What could explain this? What settings could I check at debug time to see why an output line for a MyLog.Debug line doesn't come out in the output window? namespace IntranetSync { public class MyDataSet { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MyDataSet)); public static MyDataSet GetInstance() { MyLog.Debug("MyDataSet GetInstance() ====================================="); if (myDataSet == null) { myDataSet = new MyDataSet(); } return myDataSet; } . . . PS. What I have been doing re log4net repository initialization is putting the following line as a private variables in the classes I use logging - is this OK? static class Program { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MainForm)); . . . public class Coordinator { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MainForm)); . . . public class MyDataSet { private static readonly ILog MyLog = LogManager.GetLogger(typeof(MyDataSet)); . . .

    Read the article

  • Convert Excel Range to ADO.NET DataSet or DataTable, etc.

    - by htbrady
    I have an Excel spreadsheet that will sit out on a network share drive. It needs to be accessed by my Winforms C# 3.0 application (many users could be using the app and hitting this spreadsheet at the same time). There is a lot of data on one worksheet. This data is broken out into areas that I have named as ranges. I need to be able to access these ranges individually, return each range as a dataset, and then bind it to a grid. I have found examples that use OLE and have got these to work. However, I have seen some warnings about using this method, plus at work we have been using Microsoft.Office.Interop.Excel as the standard thus far. I don't really want to stray from this unless I have to. Our users will be using Office 2003 on up as far as I know. I can get the range I need with the following code: MyDataRange = (Microsoft.Office.Interop.Excel.Range) MyWorkSheet.get_Range("MyExcelRange", Type.Missing); The OLE way was nice as it would take my first row and turn those into columns. My ranges (12 total) are for the most part different from each other in number of columns. Didn't know if this info would affect any recommendations. Is there any way to use Interop and get the returned range back into a dataset?

    Read the article

  • Advice on using .Net WorkFlow State Machine. What would you do?

    - by jlafay
    So I've been tasked at work to write windows services to replace some old legacy VB6 WinForms apps currently running as services, consistently repeating tasks day-to-day. To give some general background, they have there own state machines built in to handle decision basing and not utilizing threading. A lot of the senior developers here thought it would be worth a try to look into WorkFlow to replace the state machines rather than write my own business logic and try threading it programmaticly. So it's WF vs. the "Old College Try" I suppose. My concern is that there aren't many books on the topic, and since it was implemented in .Net I've heard very little about it being used. I brought this up at work and another developer mentioned that it's because Biz Talk never really caught on and it was designed for that. So is it broken? Do you think it will be supported long enough to not worry so much? I don't want an ill-functioning process injected into my services, my new babies at work, and then have WF's keel over. Leaving me with having to replace them with my own code in the event of an emergency; which does not seem like much of a grand scenario to me. Any suggestions, recommendations would be super.

    Read the article

< Previous Page | 103 104 105 106 107 108 109 110 111 112 113  | Next Page >