Search Results

Search found 923 results on 37 pages for 'messagebox'.

Page 16/37 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Excel Save fails in Windows 7

    - by Karthik
    Hi, I have created an application to interact with Excel in C#.net The API to save the Excel Excel._Workbook m_oWorkBook; m_oWorkBook.Save(); Throws up a File Saveas MessageBox though the workbook was already saved in a given name. Note: This happens only in Windows 7 & only when another Workbook was already opened. Any clues.

    Read the article

  • Attribute to skip over statement in unit test c#

    - by Eli Perpinyal
    I am looking to skip a certain statement in my unit tests eg: if (MessageBox.Show("Are you sure you want to remove " + contact.CompanyName + " from the contacts?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes) is there an attribute i can place above the statement to avoid the unit test executing it?

    Read the article

  • Messenger -"Register" an instance and not a type with the MVVM Light Toolkit?

    - by vidalsasoon
    Hello i'm consfused using the Messenger class of MVVM Light. I have a ProductsViewModel that can get initialized a number of times. In the constructor of ProductsViewModel I have this code: Messenger.Default.Register(this, n = MessageBox.Show(n.Test)); The problem is, if I have 2 instances of ProductsViewModel, then Messenger gets registered twice. Is is bad to Register the Messenger in a constructor? Hope this makes sense!

    Read the article

  • How to refer to a text in an Ms Access table?

    - by manuel
    I want to refer to a data cell, which if it is equals to some string, it will do something. The codes: If ds.Tables(0).Rows(i)("Status") = "Reserved" Then MessageBox.Show("Can't reserve") End If Is this the correct way to do this? Because I failed doing so..

    Read the article

  • What is a Managed Prototype?

    - by Vidar
    I just need clarification on what a managed prototype is. I think it is a method that uses the DLLImport attribute and has a method like so: [DllImport("user32.dll")] private static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type); Does it always mean this i.e you must have a DLLImport attribute and then a method signiture which is a private static extern??? Cheers

    Read the article

  • How to intercept an Exit event for a Windows Form in VB?

    - by Dooms101
    When a user clicks on the little red "x" a.k.a. the form close button on the form command bar, what even is activated besides FormClosed() I know FormClosing() is called, but I cannot really stop the form from closing after my code is run. I want to be able to show a messagebox that asks if the user wants to exit the form or not. Obviously if they click no, I want the form to stay open, how would I do this?

    Read the article

  • Equivalent of System.Windows.Forms.Cursor in Web Application(Asp.Net)

    - by Vishwa
    Hi I have a code in windows application now i am trying to implement in web Application but it is showimg that it ths no cursor class (System.Windows.Forms.Cursor )so..wat is the equivalent in web application. Here is my code private void btnGo_Click(System.Object sender, System.EventArgs e) { this.Cursor = Cursors.WaitCursor; Application.DoEvents(); // Load the images. Bitmap bm1 = (Bitmap) (Image.FromFile(txtFile1.Text)); Bitmap bm2 = (Bitmap) (Image.FromFile(txtFile2.Text)); // Make a difference image. int wid = Math.Min(bm1.Width, bm2.Width); int hgt = Math.Min(bm1.Height, bm2.Height); Bitmap bm3 = new Bitmap(wid, hgt); // Create the difference image. bool are_identical = true; int r1; int g1; int b1; int r2; int g2; int b2; int r3; int g3; int b3; Color eq_color = Color.White; Color ne_color = Color.Transparent; for (int x = 0; x <= wid - 1; x++) { for (int y = 0; y <= hgt - 1; y++) { if (bm1.GetPixel(x, y).Equals(bm2.GetPixel(x, y))) { bm3.SetPixel(x, y, eq_color); } else { bm1.SetPixel(x, y, ne_color); are_identical = false; } } } // Display the result. picResult.Image = bm1; Bitmap Logo = new Bitmap(picResult.Image); Logo.MakeTransparent(Logo.GetPixel(1, 1)); picResult.Image = (Image)Logo; this.Cursor = Cursors.Default; if ((bm1.Width != bm2.Width) || (bm1.Height != bm2.Height)) { are_identical = false; } if (are_identical) { MessageBox.Show("The images are identical"); } else { MessageBox.Show("The images are different"); } //bm1.Dispose() // bm2.Dispose() }

    Read the article

  • show line in exception.message

    - by Crash893
    How would one display what line number caused the error and is this even possible with the way that .net compiles its exes? If not is there an automated way for exception.message to display the sub that crapped out? try { int x = textbox1.text; } catch(exception ex) { messagebox.show(ex.message); }

    Read the article

  • What's Wrong With My VB.NET Code Of Windows Forms Application?

    - by Krishanu Dey
    I've to forms frmPrint & frmEmail and a dataset(MyDataset) with some DataTable and DataTable Adapters. In frmPrint I've the following Sub Public Sub StartPrinting() try adapterLettersInSchedules.Fill(ds.LettersInSchedules) adapterLetters.Fill(ds.Letters) adapterClients.Fill(ds.Clients) adapterPrintJobs.GetPrintJobsDueToday(ds.PrintJobs, False, DateTime.Today) For Each prow As MyDataSet.PrintJobsRow In ds.PrintJobs Dim lisrow As MyDataSet.LettersInSchedulesRow = ds.LettersInSchedules.FindByID(prow.LetterInScheduleID) If lisrow.Isemail = False Then Dim clientrow As MyDataSet.ClientsRow = ds.Clients.FindByClientID(prow.ClientID) Dim letterrow As MyDataSet.LettersRow = ds.Letters.FindByID(lisrow.LetterID) 'prow. 'lisrow.is Label1.SuspendLayout() Label1.Refresh() Label1.Text = "Printing letter" txt.Rtf = letterrow.LetterContents txt.Rtf = txt.Rtf.Replace("<%Firstname%>", clientrow.FirstName) txt.Rtf = txt.Rtf.Replace("<%Lastname%>", clientrow.LastName) txt.Rtf = txt.Rtf.Replace("<%Title%>", clientrow.Title) txt.Rtf = txt.Rtf.Replace("<%Street%>", clientrow.Street) txt.Rtf = txt.Rtf.Replace("<%City%>", clientrow.City) txt.Rtf = txt.Rtf.Replace("<%State%>", clientrow.State) txt.Rtf = txt.Rtf.Replace("<%Zip%>", clientrow.Zip) txt.Rtf = txt.Rtf.Replace("<%PhoneH%>", clientrow.PhoneH) txt.Rtf = txt.Rtf.Replace("<%PhoneW%>", clientrow.PhoneW) txt.Rtf = txt.Rtf.Replace("<%Date%>", DateTime.Today.ToShortDateString) Try PDoc.PrinterSettings = printDlg.PrinterSettings PDoc.Print() prow.Printed = True adapterPrintJobs.Update(prow) Catch ex As Exception End Try End If Next prow ds.PrintJobs.Clear() Catch ex As Exception MessageBox.Show(ex.Message, "Print", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub And in frmEmail i've the Following Sub Public Sub SendEmails() try adapterLettersInSchedules.Fill(ds.LettersInSchedules) adapterLetters.Fill(ds.Letters) adapterClients.Fill(ds.Clients) adapterEmailJobs.GetEmailJobsDueToday(ds.EmailJobs, False, Today) Dim ls_string As String For Each prow As MyDataSet.EmailJobsRow In ds.EmailJobs Dim lisrow As MyDataSet.LettersInSchedulesRow = ds.LettersInSchedules.FindByID(prow.LetterInScheduleID) If lisrow.Isemail = True Then Dim clientrow As MyDataSet.ClientsRow = ds.Clients.FindByClientID(prow.ClientID) Dim letterrow As MyDataSet.LettersRow = ds.Letters.FindByID(lisrow.LetterID) txt.Rtf = letterrow.LetterContents ls_string = RTF2HTML(txt.Rtf) ls_string = Mid(ls_string, 1, Len(ls_string) - 176) If ls_string = "" Then Throw New Exception("Rtf To HTML Conversion Failed") Label1.SuspendLayout() Label1.Refresh() Label1.Text = "Sending Email" If SendEmail(clientrow.Email, ls_string, letterrow.EmailSubject) Then Try prow.Emailed = True adapterEmailJobs.Update(prow) Catch ex As Exception End Try Else prow.Emailed = False adapterEmailJobs.Update(prow) End If End If Next prow Catch ex As Exception MessageBox.Show(ex.Message, "Email", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub I'm running this two subs using two different Threads. Public th As New Thread(New ThreadStart(AddressOf StartFirstPrint)) Public th4 As New Thread(New ThreadStart(AddressOf sendFirstEmail)) Here is the code of StartFirstPrint and sendFirstEmail Public Sub StartFirstPrint() Do While thCont Try Dim frm As New frmPrint() 'frm.MdiParent = Me frm.StartPrinting() Catch ex As Exception End Try Loop End Sub Public Sub sendFirstEmail() Do While thCont Try Dim frmSNDEmail As New frmEmail frmSNDEmail.SendEmails() Catch ex As Exception End Try Loop End Sub the thCont is a public boolean variable that specifies when to shop those threads. Most Of the time this works very well. But some times it gives errors Like the following image I don't know why is this occurring. Please help me.

    Read the article

  • Building IronRuby WPF GUIs

    - by Vlad
    This may be a silly question but I was under the impression that it was possible to use IronRuby and MS Visual Studio 2010 together to sort of build interfaces\edit XAML in one window and code ruby in the other? Is this only possible to do with C#, Basic and C++ ? I've browsed SO and seen some IronRuby snippets like this one: button1.click do |sender, args| MessageBox.show("Hello World!") end So it stands to reason you can create GUIs somehow, but is the visual gui creator not available for ironruby?

    Read the article

  • C#:checking existing record in database Mysql

    - by Meko
    HI.I searched this question inform and I found solution to change column property Unique Index.Now If I try to insert same record cmd.ExecuteNonQuery() gives error that record exist ,but how can use this exception to give user a message that record exist and must enter new one ? I am trying to make some thing like if(cmd.ExecuteNonQuery() !=true ) { MessageBox.Show("User Exists"); } But I dont know what returns cmd.ExecuteNonQuery() ? Or I must get records using reader in table and compare them with text in Textfiel?

    Read the article

  • How to get JOptionPane with three text fields

    - by Dr.Mostafa
    I want to know how i can do a messageBox from three input dialog .. Like this: JOptionPane.showInputMessageDialog("Enter your FirstName"); JOptionPane.showInputMessageDialog("Enter your MiddleName"); JOptionPane.showInputMessageDialog("Enter your LastName"); But I want one message has a three input boxes.

    Read the article

  • MSI not running the current version of the code in .NET Setup project.

    - by Swami
    I'm not sure what happened, but my installer is in a weird state--when I install my MSI, it doesn't seem to be running the current version of the code (I'm using Custom Actions). I verified it by placing some MessageBox.Shows and sure enough, they are not popping up. It's possible I may have had a few unsuccessful installs previously which may have put the installer in a bad state...but how do I go about resolving this? Thanks...

    Read the article

  • Buffer Overrun Issues VC++

    - by sijith
    When i execute my code i am getting this error LPTSTR lpBuffer; ::GetLogicalDriveStrings(1024,lpBuffer); while(*lpBuffer != NULL) { printf("%s\n", lpBuffer); // or MessageBox(NULL, temp, "Test", 0); or whatever lpBuffer += lstrlen(lpBuffer)+1; printf("sizeof(lpBuffer) %d\n",lstrlen(lpBuffer)); } OutPut C sizeof(lpBuffer) 3 D sizeof(lpBuffer) 3 E sizeof(lpBuffer) 3 F sizeof(lpBuffer) 0

    Read the article

  • How to modify TaskDialog's Show() call to be blocking and return a value when closed?

    - by JustABill
    I'm using the WindowsAPICodePack's TaskDialog implementation, but it bugs me that I have to listen to click handlers on its buttons for even the more basic implementations. I'd like to convert/wrap it so that like the old MessageBox it blocks until closed and then returns a value based on what was done. Is there anything I can read for the basics on how to do this? I just have no idea where to even start, as I am admittedly not that familiar with the Win32 underpinnings.

    Read the article

  • C# work with functions

    - by gloris
    Hi, I'am new with C#. How works in C# functions? My try: private void Form1_Load(object sender, EventArgs e) { MessageBox.Show(Convert.ToString(number_p(5))); } public void number_p(int number) { int one = 1; number = number + one; return number; } Error: return, why? Thanks

    Read the article

  • Using Message Boxes in Windows 7 style

    - by Meta
    After reading the MSDN article about proper user interface here: http://msdn.microsoft.com/en-us/library/aa974176.aspx I want to modify the message boxes I use in my applications to reflect those guidelines (for example, have the Main Instructions in a larger font, better named Buttons, etc...). My question is, is there an API that allows you to easily build those kind of message boxes (a la user32\MessageBox()), or do you actually have to build your own message boxes which follow the guidelines?

    Read the article

  • vb.net datadrig view get each cell value

    - by Gbolahan
    hello i'm trying to get the first value of a datagrid cell value but it keeps looping trough and returns the last value. here is the code: Dim cell As DataGridViewCell txtoccupier.Text = "" Try For Each cell In dgvREcord.CurrentRow.Cells() txtoccupier.Text = cell.Value.ToString Next Catch ex As Exception MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Exit Try End Try record eample: id name email 1 test [email protected] it returns only [email protected] but i want to get only the id which is 1 thanks for your help

    Read the article

  • C# Attributes Aren't Supposed to Inherit

    - by Adam
    Since attributes don't inherit in C# (at least I didn't think they did) - how does the following code still display the Hello popup when the MyTestMethod test is run: [TestClass] public class BaseTestClass { [TestInitialize] public void Foo() { System.Windows.Forms.MessageBox.Show("Hello"); } } [TestClass] public class TestClass : BaseTestClass { [TestMethod] public void MyTestMethod() { Assert.IsTrue(true); } }

    Read the article

  • [C#] NodeMouseClick event doesn't work correctly ???

    - by Wayne
    i use a treeview to display files and folders like Windows Explorer. it has a NodeMouseClick event but sometimes when i click +, this event doesn't fire. private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { MessageBox.Show("node mouse click"); } can anyone explain for me why ? and how to know whenever i click + ? thanks in advance!

    Read the article

  • How to check results of LINQ to SQL query?

    - by rem
    In a WPF app I'd like to check if a return of a LINQ to SQL query contains some records, but my approach doesn't work: TdbDataContext context = new TdbDataContext(); var sh = from p in context.Items where p.Selected == true select p; if (sh == null) { MessageBox.Show("There are no Selected Items"); } Where am I wrong?

    Read the article

  • How to get reference of activity object ?

    - by Fevos
    Hi i want to show messageBox or notification when connection lost in Static DB class but i cant use getApplicationContext() becouse its a static class and i tried to call other class called notification but i have error so how i could pass activity object to my new class .

    Read the article

  • Show dialog after Application.Exit()

    - by Bryce Wagner
    Under certain circumstances, I wish to display an error message to the user if the application didn't shut down, but MessageBox.Show() doesn't actually do anything after calling Application.Exit(). Is there a way to convince it to show a dialog after Application.Exit()?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >