Search Results

Search found 958 results on 39 pages for 'dispose'.

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

  • What is a good practice for handling SQL connections within a WCF call?

    - by Rising Star
    Suppose I want to create a (stateless) WCF service with three methods exposed on an endpoint: performSqlOperationA(), performSqlOperationB(), and performSqlOperationC(). Each method inserts data into a SQL database. The way I've seen things done at my office, each method would begin with code to initialize a SqlConnection object. Each method would end with code to safely dispose it. What is a good practice for coding these WCF methods so that the SqlConnection object is initialized and disposed in each method without having to do these things in each method? I know that I can have the connection initialized in the constructor for the class for the WCF methods, but I don't know about disposing it... The calls cannot be wrapped in a using block. One solution I'm familiar with is PostSharp, which allows me to set an attribute which causes specific code to automatically run at the beginning and end of each method call, but it would be greatly preferable to do this with only the .net framework.

    Read the article

  • multiple rows of a single table

    - by Amanjot Singh
    i am having a table with 3 col. viz id,profile_id,plugin_id.there can be more than 1 plugins associated with a single profile now how can i fetch from the database all the plugins associated with a profile_id which comes from the session variable defined in the login page when I try to apply the query for the same it returns the data with the plugin_id of the last record the query is as follows SqlCommand cmd1 = new SqlCommand("select plugin_id from profiles_plugins where profile_id=" + Convert.ToInt32(Session["cod"]), con); SqlDataReader dr1 = cmd1.ExecuteReader(); if (dr1.HasRows) { while (dr1.Read()) { Session["edp1"] = Convert.ToInt32(dr1[0]); } } dr1.Close(); cmd1.Dispose();

    Read the article

  • JTable how to change BackGround Color

    - by mKorbel
    I inspired by MeBigFatGuy interesting question, in this conection I have very specific question about Graphisc2D, how to change BackGround Color by depends if is JTables Row visible in the JViewPort, 1) if 1st. & last JTables Row will be visible in the JViewPort, then BackGround would be colored to the Color.red 2) if 1st. & last JTables Row will not be visible in the JViewPort, then BackGround would be colored to the Color.whatever from SSCCE import java.awt.*; import java.awt.event.ActionEvent; import java.awt.image.BufferedImage; import javax.swing.*; import javax.swing.RepaintManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.table.TableModel; /* http://stackoverflow.com/questions/1249278/ how-to-disable-the-default-painting-behaviour-of-wheel-scroll-event-on-jscrollpan * and * http://stackoverflow.com/questions/8195959/ swing-jtable-event-when-row-is-visible-or-when-scrolled-to-the-bottom */ public class ViewPortFlickering { private JFrame frame = new JFrame("Table"); private JViewport viewport = new JViewport(); private Rectangle RECT = new Rectangle(); private Rectangle RECT1 = new Rectangle(); private JTable table = new JTable(50, 3); private javax.swing.Timer timer; private int count = 0; public ViewPortFlickering() { GradientViewPort tableViewPort = new GradientViewPort(table); viewport = tableViewPort.getViewport(); viewport.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { RECT = table.getCellRect(0, 0, true); RECT1 = table.getCellRect(table.getRowCount() - 1, 0, true); Rectangle viewRect = viewport.getViewRect(); if (viewRect.intersects(RECT)) { System.out.println("Visible RECT -> " + RECT); } else if (viewRect.intersects(RECT1)) { System.out.println("Visible RECT1 -> " + RECT1); } else { // } } }); frame.add(tableViewPort); frame.setPreferredSize(new Dimension(600, 300)); frame.pack(); frame.setLocation(50, 100); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); RepaintManager.setCurrentManager(new RepaintManager() { @Override public void addDirtyRegion(JComponent c, int x, int y, int w, int h) { Container con = c.getParent(); while (con instanceof JComponent) { if (!con.isVisible()) { return; } if (con instanceof GradientViewPort) { c = (JComponent) con; x = 0; y = 0; w = con.getWidth(); h = con.getHeight(); } con = con.getParent(); } super.addDirtyRegion(c, x, y, w, h); } }); frame.setVisible(true); start(); } private void start() { timer = new javax.swing.Timer(100, updateCol()); timer.start(); } public Action updateCol() { return new AbstractAction("text load action") { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { System.out.println("updating row " + (count + 1)); TableModel model = table.getModel(); int cols = model.getColumnCount(); int row = 0; for (int j = 0; j < cols; j++) { row = count; table.changeSelection(row, 0, false, false); timer.setDelay(100); Object value = "row " + (count + 1) + " item " + (j + 1); model.setValueAt(value, count, j); } count++; if (count >= table.getRowCount()) { timer.stop(); table.changeSelection(0, 0, false, false); java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { table.clearSelection(); } }); } } }; } public static void main(String[] args) { java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { ViewPortFlickering viewPortFlickering = new ViewPortFlickering(); } }); } } class GradientViewPort extends JScrollPane { private static final long serialVersionUID = 1L; private final int h = 50; private BufferedImage img = null; private BufferedImage shadow = new BufferedImage(1, h, BufferedImage.TYPE_INT_ARGB); private JViewport viewPort; public GradientViewPort(JComponent com) { super(com); viewPort = this.getViewport(); viewPort.setScrollMode(JViewport.BLIT_SCROLL_MODE); viewPort.setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE); viewPort.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); Graphics2D g2 = shadow.createGraphics(); g2.setPaint(new Color(250, 150, 150)); g2.fillRect(0, 0, 1, h); g2.setComposite(AlphaComposite.DstIn); g2.setPaint(new GradientPaint(0, 0, new Color(0, 0, 0, 0f), 0, h, new Color(0.5f, 0.8f, 0.8f, 0.5f))); g2.fillRect(0, 0, 1, h); g2.dispose(); } @Override public void paint(Graphics g) { if (img == null || img.getWidth() != getWidth() || img.getHeight() != getHeight()) { img = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB); } Graphics2D g2 = img.createGraphics(); super.paint(g2); Rectangle bounds = getViewport().getVisibleRect(); g2.scale(bounds.getWidth(), -1); int y = (getColumnHeader() == null) ? 0 : getColumnHeader().getHeight(); g2.drawImage(shadow, bounds.x, -bounds.y - y - h, null); g2.scale(1, -1); g2.drawImage(shadow, bounds.x, bounds.y + bounds.height - h + y, null); g2.dispose(); g.drawImage(img, 0, 0, null); } }

    Read the article

  • Animated record deletion with jquery like mootools example

    - by twitter
    I was reading around and saw this example from David Walsh about how to animate record deletion with mootools. Does the exact same effect exist in jquery? This is his mootools code. window.addEvent('domready',function() { $$('a.delete').each(function(el) { el.addEvent('click',function(e) { e.stop(); var parent = el.getParent('div'); var request = new Request({ url: 'mootools-record-delete.php', link: 'chain', method: 'get', data: { 'delete': parent.get('id').replace('record-',''), ajax: 1 }, onRequest: function() { new Fx.Tween(parent,{ duration:300 }).start('background-color', '#fb6c6c'); }, onSuccess: function() { new Fx.Slide(parent,{ duration:300, onComplete: function() { parent.dispose(); } }).slideOut(); } }).send(); }); }); });

    Read the article

  • Improving WPF memory usage

    - by Krishna
    Hello developers Is there any way you can store the UI state to disk when a WPF form has been minimised. I have a complex GUI with few Tab Controls and it consumes quite a bit of memory which is kept allocated when the application is not active. I was hoping one of you may have got this working along the lines (or similar) Application Active User does work, plays with UI - enters some information in the text boxes and moves around the tabs User minimises the form to work with other applications On Minimise, Save the current state to the disk and dispose the root tabcontrol On Activiate, build the root tabcontrol from the disk and add to the controls collection Before I divein to do this, I thought it will help me if I ask this question here. Please let me know your thoughts

    Read the article

  • return statement from within using

    - by Bob
    using (IDbCommand command = new SqlCommand()) { IDbDataAdapter adapter = new SqlDataAdapter(); DataSet ds = new DataSet(); adapter.SelectCommand = command; command.Connection = _dataAccess.Connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "GetProcData"; command.Parameters.Add(new SqlParameter("@ProcID ", procId)); adapter.Fill(ds); return ds.Tables[0].AsEnumerable(); } This returns an IEnumerable DataRow The question is that since the return is within the using statement, will it property dispose of the IDBCommand? I know I can easily refactor this so I change the scope of the DataSet outside of the using, but it is more of a wonder than anything else.

    Read the article

  • how to get empty row in DropDownList

    - by Gali
    hi i have this citys in my database: city1 city2 city3 city4 i what to see this in my DropDownList: [empty] city1 city2 city3 city4 this is my bind code: SQL = "select distinct City from MyTbl order by City"; dsClass = new DataSet(); adp = new SqlDataAdapter(SQL, Conn); adp.Fill(dsClass, "MyTbl"); adp.Dispose(); DropDownList3.DataSource = dsClass.Tables[0]; DropDownList3.DataTextField = dsClass.Tables[0].Columns[0].ColumnName.ToString(); DropDownList3.DataValueField = dsClass.Tables[0].Columns[0].ColumnName.ToString(); DropDownList3.DataBind(); how to do it (asp.net C#) ? thanks in advance

    Read the article

  • Fibonacci Numbers in Haskell

    - by boraer
    Hi everbody I need to change my F# code to Haskell code but I am so new in Haskell and I can not this My code simply read data from keyboard if data not an integer return an error message then calculate the n fibonacci number then writes to a list after that writes the list into a txt file Here is my code open System let rec fib n = match n with |0->0 |1->1 |2->1 |n->fib(n-1)+fib(n-2);; let printFibonacci list = for i=0 to (List.length list)-1 do printf "%d " (list.Item(i));; let writeToFile list = let file = System.IO.File.Create("C:\out2.txt") let mutable s ="" let writer = new System.IO.StreamWriter(file) try for i=0 to (List.length list)-1 do s <- list.Item(i).ToString() writer.Write(s+" ") finally writer.Close() file.Dispose() printfn "Writed To File" let mutable control = true let mutable num = 0 while control do try printfn "Enter a Number:" num <- Convert.ToInt32(stdin.ReadLine()) let listFibonacci = [for i in 0 .. num-1->fib(i)] printFibonacci(listFibonacci) printfn "\n%A"(listFibonacci) writeToFile(listFibonacci) control<-false with | :? System.FormatException->printfn "Number Format Exception"; Console.ReadKey true|>ignore

    Read the article

  • Where best to instantiate and close a Silverlight-enabled WCF Service from the Silverlight app?

    - by Yttrium
    When using a Silverlight-enabled WCF service, where is the best place to instantiate the service and to call the CloseAsync() method? Should you say, instantiate an instance each time you need to make a call to the service, or is it better to just instantiate an instance as a variable of the UserControl that will be making the calls? Then, where is it better to call the CloseAsync method? Should you call it in each of the "someServiceCall_completed" event methods? Or, if created as a variable of the UserControl class, is there a single place to call it? Like a Dispose method, or something equivalent for the UserControl class. Thanks, Jeff

    Read the article

  • Explain the code: c# locking feature and threads

    - by Mendy
    I used this pattern in a few projects, (this snipped of code is from CodeCampServer), I understand what it does, but I'm really interesting in an explanation about this pattern. Specifically: Why is the double check of _dependenciesRegistered. Why to use lock (Lock){}. Thanks. public class DependencyRegistrarModule : IHttpModule { private static bool _dependenciesRegistered; private static readonly object Lock = new object(); public void Init(HttpApplication context) { context.BeginRequest += context_BeginRequest; } public void Dispose() { } private static void context_BeginRequest(object sender, EventArgs e) { EnsureDependenciesRegistered(); } private static void EnsureDependenciesRegistered() { if (!_dependenciesRegistered) { lock (Lock) { if (!_dependenciesRegistered) { new DependencyRegistrar().ConfigureOnStartup(); _dependenciesRegistered = true; } } } } }

    Read the article

  • cannot create new object in ActiveDirectory

    - by Humanier
    Hi. I'm trying to add new object to existing organisational unit in Active Directory. Following code is used to do this. It runs without errors. But new object is not created after this. Please advise what I'm doing wrong here. using System.DirectoryServices; using System.DirectoryServices.ActiveDirectory; namespace TestAdObjectCreation { class Program { static void Main(string[] args) { DirectoryEntry root = new DirectoryEntry("LDAP://servername/OU=Services,OU=PCX,DC=q2q,DC=xenyq,DC=com", "Administrator", "pass"); DirectoryEntry newItem = root.Children.Add("test_node", "valid_schema_class_name"); root.CommitChanges(); root.Close(); root.Dispose(); } } }

    Read the article

  • C# - Erase all property values from a class?

    - by John M
    In a C# Winforms (3.5) application I have added a class that contains many properties (get/set) used to stored values from a 12 form long process. After form 12 I would like wipe out all the property values in the storing class so that the next user won't accidentally record values when starting the process at form 1. Is it possible to erase/destroy/dispose of all property values in a class? My class looks like this: private static int battery; public int Battery { get { return storeInspectionValues.battery; } set { storeInspectionValues.battery = value; } }

    Read the article

  • Why did the C# designers attach three different meanings to the 'using' keyword?

    - by gWiz
    The using keyword has three disparate meanings: type/namespace aliasing namespace import syntactic sugar for ensuring Dispose is called The documentation calls the first two definitions directives (which I'm guessing means they are preprocessing in nature), while the last is a statement. Regardless of the fact that they are distinguished by their syntaxes, why would the language developers complicate the semantics of the keyword by attaching three different meanings to it? For example, (disclaimer: off the top of my head, there may certainly be better examples) why not add keywords like alias and import? Technical, theoretical, or historical reasons? Keyword quota? ;-) Contrived sample: import System.Timers; alias LiteTimer=System.Threading.Timer; alias WinForms=System.Windows.Forms; public class Sample { public void Action { var elapsed = false; using(var t = new LiteTimer.Timer(_ => elapsed = true) { while (!elapsed) CallSomeFinickyApi(); } } } "Using" is such a vague word.

    Read the article

  • Access the camera of a Smartphone using libGDX

    - by PH-zero
    I searched the web, browsed through the libGDX wiki, but without success. My Question: Is there a way, to access the camera of smartphones, let the user take a photo, and then store the image in a Texture-instance? I could imagin something like this: @Override public void onCamTrigger(){ ApplicationType appType = Gdx.app.getType(); switch (appType) { case Android: case iOS: Texture someTexture = new Texture(Gdx.input.getCamera().getImage()); //do something with the Texture instance... someTexture.dispose(); break; default: break; } } Of course this is pure fiction! I know that there's a lot more to this like opening the camera, displaying it, then take a photo etc. . But is there a convenience method like this? If so, how does it work? On Android, i think i could implement it without using any convenience methods offered by libGDX, but i have no idea on how this works on iOS =/

    Read the article

  • DoWork of BackgroundWorker is called twice when RunWorkerAsync is called once?

    - by Power-Mosfet
    I have create a backgroundworker in an class it works, but if i call and wait until the end run, call it for the second time it will do the same process twice i thinks there is somthing wrong with bw.DoWork += private void button1_Click(object sender, EventArgs e) { nptest.test.start("null", "null"); } namespace nptest { class test { public static void start(string str, string strb) { if (bw.IsBusy != true) { bw.WorkerSupportsCancellation = true; bw.DoWork += (obj, e) => bw_DoWork(str, strb); bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted); bw.RunWorkerAsync(); } } private static BackgroundWorker bw = new BackgroundWorker(); private static void bw_DoWork(string str, string strb) { System.Windows.Forms.MessageBox.Show("initializing BackgroundWorker"); } private static void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if ((e.Cancelled == true)) { Console.WriteLine("Canceled"); } else if (!(e.Error == null)) { Console.WriteLine("Error: " + e.Error.Message); } bw.Dispose(); } } }

    Read the article

  • Questions about nhibernate.

    - by chobo2
    Hi I have a couple questions about nhibernate. I still don't understand what contextual sessions means. I do web stuff so I just choose "web" but I really don't know what it is doing. Should I put session.BeginTransaction() in Application_BeginRequest? Should I commit everything in Application_EndRequest? Or should I commit when needed. Say I need to insert a user and then down in some code later I need to update some other table. Should I make the user and do the update then finally commit or should I wait till both are ready to be commited? Should you always have session.Rollback() in Application_EndRequest? Should I session.close() or session.dispose() or both in Application_EndRequest?

    Read the article

  • Not all Code Paths return a Value Issue

    - by jorame
    I have this peace of code in a class(DataBase) and I'm getting "Not all Paths return a Value". Any help will be really appreciated. public static DataSet DELETE_PDT(String rowid) { SqlConnection con = new SqlConnection(); SqlCommand cmd = new SqlCommand("sp_DELETE_PDT", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@rowid", SqlDbType.Int).Value = rowid; con.ConnectionString = ConfigurationManager.ConnectionStrings["WMS"].ConnectionString; try { con.Open(); cmd.ExecuteNonQuery(); cmd.Dispose(); con.Close(); } catch (Exception ex) { throw new Exception("Error while deleting record. Please contact your System Administrator", ex); } }

    Read the article

  • Reading a file over a network path

    - by Sin5k4
    I have this weird issue,when I use > File FileToRead = new File("\\\\MYSERVER\\MYFOLDER\\MYFOLDER\\MYPICTURE.JPG"); to read a file over a network,all I get is a null pointer exception.Normally a local path works with this,but when on a network path,I just couldn't manage to get it to work.Any ideas? PS:oh and my network connection seems to work,no issues when accessing data in windows explorer... More of the code: File FileToRead = new File("file://DOKSERVICE/Somefolder/ProductImage/01001.JPG"); // File FileToRead = new File("c:\\dog.jpg"); local test BufferedImage image = ImageIO.read(FileToRead); BufferedImage resizedimage = new BufferedImage(260, 260,BufferedImage.TYPE_INT_RGB ); Graphics2D g = resizedimage.createGraphics(); g.drawImage(image, 0, 0, 260, 260, null); g.dispose(); picture.setIcon(new ImageIcon(image));

    Read the article

  • Resizing gives me to heavy image

    - by phenevo
    Hi, I'm resizing jpeg 1200x900 ,556kb by method: public static Image ResizeImage(Image imgToResize, int height) //height=400 { int destWidth; int destHeight; int sourceWidth = imgToResize.Width; int sourceHeight = imgToResize.Height; float nPercent = 0; float nPercentH = 0; nPercentH = ((float)height / (float)sourceHeight); nPercent = nPercentH; destWidth = (int)(sourceWidth * nPercent); destHeight = height; Bitmap b = new Bitmap(destWidth, destHeight); Graphics g = Graphics.FromImage((Image)b); g.InterpolationMode = InterpolationMode.HighQualityBicubic; g.DrawImage(imgToResize, 0, 0, destWidth, destHeight); g.Dispose(); return b; } gives me 555kb 533x400 jpeg. Why this photo is so heavy. For photo jpeg 2111kb 2156x1571 I get 556kb 533x400 jpeg Why in first case is so terrible !

    Read the article

  • How do i generate thumbnail image for use with img tag ? Java web application.

    - by Nitesh Panchal
    Hello, I am using the below given code, but it is not working properly. Can anybody tell me how do i generate thumbnail of the image? because i am creating a photo album and i want only thumbnail images to be downloaded at first, not the entire 400-500 kb images. File objFile = new File(strImageFullPath); File targetFile = new File(strImageFullPathWithoutExt + "_small" + strFileExtension); Image image = ImageIO.read(objFile); final int WIDTH = 150; final int HEIGHT = 150; Image thumbnailImage = image.getScaledInstance(WIDTH, HEIGHT, Image.SCALE_DEFAULT); BufferedImage objThumbnailBufferedImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); Graphics gfx = objThumbnailBufferedImage.getGraphics(); gfx.drawImage(image, 0, 0, null); gfx.dispose(); ImageIO.write(objThumbnailBufferedImage, strFileExtension.substring(1), targetFile); Just assume that few variables like strImageFullPath,strImageFullPathWithoutExt etc they exist. Thanks in advance :)

    Read the article

  • Showing/Hiding the main form in C#

    - by DazSlayer
    I am working on a program where clicking on a button on form1 will open form2. I will then hide form1 until form2 is closed. The problem I have is that I cannot get form1 to show after form2 closes. Any ideas on how to fix this? try { Form1.ActiveForm.Hide(); AddGradeForm = new Form2(Form.NumberOfSelections); AddGradeForm.ShowDialog(); MessageBox.Show(AddGradeForm.Result.ToString()); } catch (Exception i) { Form1.ActiveForm.Hide(); AddGradeForm.Dispose(); AddGradeForm = new Form2(Form.NumberOfSelections); AddGradeForm.ShowDialog(); MessageBox.Show(AddGradeForm.Result.ToString()); } Form1.ActiveForm.Show(); ERROR: NullReferenceException was unhanded. Object reference not set to an instance of an object.

    Read the article

  • How to run a progress-bar through an insert query?

    - by Gold
    I have this insert query: try { Cmd.CommandText = @"INSERT INTO BarcodTbl SELECT * FROM [Text;DATABASE=" + PathI + @"\].[Tmp.txt];"; Cmd.ExecuteNonQuery(); Cmd.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message); } I have two questions: How can I run a progress-bar from the beginning to the end of the insert? If there is an error, I got the error exception and the action will stop - the query stops and the BarcodTbl is empty. How I can see the error and allow the query to continue filling the table?

    Read the article

  • What's the most performance effective way to have a webbrowser inside a class library ?

    - by Xaqron
    I'm developing a class library. Need some data from internet and this cannot be done with HttpWebRequest in my case so I wanna use WebBrowser component. WebBrowser is used for opening a single page and fetch some data from it, so WebBrowser life-time is very short. Running thread is MTA and no message pump or STA thread is available by default (class library is used by an ASP.NET application). How to create a WebBrowser object, run it with a STA thread, fetch data from a web page and finally dispose it with the least performance impact on the application ? I just need the idea/concept and will find details myself. Thanks guys

    Read the article

  • Speed of interpolation algorithms, C# and C++ working together.

    - by Kaminari
    Hello. I need fast implementation of popular interpolation algorithms. I figured it out that C# in such simple algorithms will be much slower than C++ so i think of writing some native code and using it in my C# GUI. First of all i run some tests and few operations on 1024x1024x3 matrix took 32ms in C# and 4ms in C++ and that's what i basicly need. Interpolation however is not a good word because i need them only for downscaling. But the question is: Will it be faster than C# methods in Drawing2D Image outputImage = new Bitmap(destWidth, destHeight, PixelFormat.Format24bppRgb); Graphics grPhoto = Graphics.FromImage(outputImage); grPhoto.InterpolationMode = InterpolationMode.*; //all of them grPhoto.DrawImage(bmp, new Rectangle(0, 0, destWidth, destHeight), Rectangle(0, 0, sourceWidth, sourceHeight), GraphicsUnit.Pixel); grPhoto.Dispose(); Some of these method run in 20ms and some in 80. Is there a way to do it faster?

    Read the article

  • Form Closing help

    - by Michael Quiles
    How can I call the button1_Click event in the form closing event so I don't have to copy and paste the code from button1_Click? public void button1_Click(object sender, EventArgs e) { //Yes or no message box to exit the application DialogResult Response; Response = MessageBox.Show("Are you sure you want to Exit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (Response == DialogResult.Yes) // Exits the application Application.Exit(); } public void xGameThemeComboBox_SelectedIndexChanged(object sender, EventArgs e) { string folder = Application.StartupPath; string theme = (string)xGameThemeComboBox.Items[xGameThemeComboBox.SelectedIndex]; string path = System.IO.Path.Combine(folder, theme + ".jpg"); Image newImage = new Bitmap(path); if (this.BackgroundImage != null) this.BackgroundImage.Dispose(); { this.BackgroundImage = newImage; } } private void xGameForm_FormClosing(object sender, FormClosingEventArgs e) { // call button1_Click here }

    Read the article

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