Search Results

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

Page 71/113 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • how to check some assembly is present in client and register that if not.

    - by Jimmy
    hi there, what i wana know is that how can i use assembly that is register in GAC in my C# application. Detail: What i wana achieved is that 1) Check ABC assembly that is register in my client machine or not from my windows application 2) If not then register that assemble in GAC of client from my windows application 3) And use this assembly and perform some functions Remember that that ABC assemble is my assembly having some of my function.

    Read the article

  • How do I play a video through .net in windows 7

    - by Mykroft
    I had setup an app to play a video using the library suggested here this worked great for me for a long time until my machine was upgraded. In windows 7 I get the following exception that I'd never seen under XP: `System.BadImageFormatException: is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) at MainApp.Controls.MediaControl.StopVideo() at System.Windows.Forms.Form.WmClose(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)` I've installed the June 2010 DirectX SDK and I'm still getting this error. Is there a different library I should be using or some setting that needs to be changed?

    Read the article

  • Can I use notepad++ exe in my application ?

    - by Harikrishna
    I am parsing html file with the help of the html agility pack to extract the table data from the html file. But there is some html files where there is no ending tags which is optional or there is no starting tag which is also optional.So html agility pack does not parse that html page properly.If I open the content of that html file in the notepad++ then with the option TestFX-->TestFX HTML Tidy-->TiDy clean document and make the content tidy like this. And now this file If I parse with the html agility pack then it parse it properly. Making html page tidy with notepad++ is best option. So I don't know but user can not do this like first he/she makes the page tidy with notepad++ and then go ahead.Then what should I do ?

    Read the article

  • SmtpClient.SendAsync(); Does not work anymore.

    - by j-t-s
    Hi All, I have recently purchased a new computer, and now my e-mails never get sent, and there are NEVER any exceptions thrown or anything. Can somebody please provide some samples that work using the SmtpClient class? Any help at all will be greatly appreciated. Thank you

    Read the article

  • Rotate view of PDF on a WinForm

    - by Dabas
    I have to display a PDF inside a winform (c# on .net 2.0 framework). For now, I am using the ActiveX PDF control provided by Adobe. I have to disable the entire control so that a user can't print or save via right-click or hotkeys. Unfortunately, many of the documents need to be rotated (just viewed, not permanently saved that way). I'd like to allow them to rotate the view by pressing a button control. I've tried enabling the control then programmatically sending the hotkeys (ctrl shift +) using SendKeys and SendInput but the timing issues make this a non-viable solution. I've asked on the proper Adobe boards and they said it was not possible being that all of my clients will only have the reader version installed.

    Read the article

  • Parsing Tabular cell data with space where there is td tag.

    - by Harikrishna
    I am parsing html tabular information with the help of the html agility pack. Now First I am finding the rows in that table like var rows = table.Descendants("tr"); then I find the cell data for each row like foreach(var row in rows) { string rowInnerText = row.InnerText; } That gives me the cell data.But with no spaces between them like NameAdressPhone No but I want the innertext like Name Address Phone No means where there is td tag I want to keep there one space between different column cell.

    Read the article

  • C# - Keep track of open child forms

    - by Nate Shoffner
    I currently have a parent control (Form1) and a child control (Form2). Form1 contains a listview that stores a list of of file data (each file is a separate item). Form2 contains only a textbox. Upon clicking on one of these listviewitems in Form1, Form2 is opened up and accesses the file's data and loads it into the textbox in Form2 in plain text format. The issue I'm having is, I would like to be able to detect, upon clicking of a listviewitem, whether that file is already opened in said child form and if so, to activate it (bring it to the front) and if it is not already opened, open it. I'm not sure what the best method of doing this would be since this can involve many child forms being open at once. This is not an MDI application. Any ideas on how this could be accomplished are appreciated and samples even more so. Thank you.

    Read the article

  • DataGridView and the CellEndEdit Event

    - by Brandon
    I have a DataGridView, and would like to hook into the CellEndEdit event. I've been able to successfully hook into the CellContentClick event, but am having issues with CellEndEdit. I added the following code to my Form1.cs file: private void dataGridView1_CellEndEdit(object sender, DataGridViewCellCancelEventArgs e) { dataGridView1[0, 0].Value = "Changed"; } With that code, nothing happens when I am done editing a cell. Is there anything else that I need to do to successfully hook into this event? I see that CellContentClick has a this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); line of code in the Form1.Designer.cs file, but I tried to mimic this for CellEndEdit, and received a compile error (No overload for 'dataGridView1_CellEndEdit' matches delegate 'System.Windows.Forms.DataGridViewCellEventHandler')

    Read the article

  • What is the most efficient way to delete all selected items in a ListViewItem collection

    - by Andrew
    My user is able to select multiple items in a ListView collection that is configured to show details (that is, a list of rows). What I want to do is add a Delete button that will delete all of the selected items from the ListViewItem collection associated with the ListView. The collection of selected items is available in ListView.SelectedItems, but ListView.Items doesn't appear to have a single method that lets me delete the entire range. I have to iterate through the range and delete them one by one, which will potentially modify a collection I'm iterating over. Any hints? Edit: What I'm basically after is the opposite of AddRange().

    Read the article

  • My winform application doesn't work on others' pc without vs 2010 installed

    - by wings
    Just like I said, my winform application works properly on computers with VS installed, but on other computers, it will crash due to a FileNotFound Exception. I used using Application = Microsoft.Office.Interop.Excel.Application; in my source code to generate a Excel file, and the problem occurs as soon as the Excel-related function is called. But I don't know what it refers to exactly. Do I have to get some .dll included along with the .exe file? And what DLL is that? Below are part of my codes: private void FileExport(object objTable) { StartWaiting(); string[,] table = null; try { table = (string[,])objTable; } catch (Exception ex) { ShowStatus(ex.Message, StatusType.Warning); } if (table == null) { return; } Application excelApp = new Application { DisplayAlerts = false }; Workbooks workbooks = excelApp.Workbooks; Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet); Worksheet worksheet = (Worksheet)workbook.Worksheets[1]; worksheet.Name = "TABLE"; for (int i = 0; i < table.GetLength(0); i++) { for (int j = 0; j < table.GetLength(1); j++) { worksheet.Cells[i + 1, j + 1] = table[i, j]; } } Range range = excelApp.Range["A1", "H1"]; range.Merge(); range.Font.Bold = true; range.Font.Size = 15; range.RowHeight = 50; range.EntireRow.AutoFit(); range = excelApp.Range["A2", "H8"]; range.Font.Size = 11; range = excelApp.Range["A1", "H8"]; range.NumberFormatLocal = "@"; range.RowHeight = 300; range.ColumnWidth = 50; range.HorizontalAlignment = XlHAlign.xlHAlignCenter; range.VerticalAlignment = XlVAlign.xlVAlignCenter; range.EntireRow.AutoFit(); range.EntireColumn.AutoFit(); worksheet.UsedRange.Borders.LineStyle = 1; Invoke(new MainThreadInvokerDelegate(SaveAs), new object[] { worksheet, workbook, excelApp } ); EndWaiting(); }

    Read the article

  • how to put a value to an array when a checkbox is checked? c#?

    - by Jan Darren Noroña
    I am making a random character generator, i have 2 forms, form1 and form2, on my form2 i have the checkboxes there, so if the user checked checkbox1, on my form1 it will only display 1 character, now if the user check all 5 checkboxes, my form1 will generate 5 characters. i have a button on form1 that will trigger an event on generating random characters. characters: '+','-','*','/','%' how will my code be? I am using WINDOWS FORMS APPLICATION. pics here: form1: http://i49.tinypic.com/30bzos8.png form2: http://i50.tinypic.com/k00ndt.png char[] select = new char[] { '+' , '-' , '*' , '/', '%' }; var rand = new Random(); char num = select[rand.Next(5)];

    Read the article

  • C# Drag and Drop Effect with Overlay/Opaque Image

    - by CallMeLaNN
    Hi, I think this would be simple question and should be asked in the pas few years but unable to google around and dont know if there is a specific keyword. In c# WinForm I want to do drag and drop but I dont want the image of DragDropEffects Move, Copy or whatever. I want to display an image with half opaque. Just like Firefox when dragging an image, you would see the image folowing the mouse pointer like a ghost :) I already Implement DoDragDrop, DragEnter and DragDrop events. I just want to customize the dragging effects with overlay image.

    Read the article

  • passing something from child form to parent

    - by Alan Bennett
    so i have this form and on it is a combo box populated from a database via a SQL method. and i have another form which allows us to maintain the database table etc. so i make a new instance of the second form doing: Form1 frm = new Form2; frm.show(); once i have done what ever i wanted to do on the second form and i close it, i need to somehow trigger an event or something which will refresh the combo box and the code behind it. i was thinking of some onchange or focus event for the whole form, the problem is i have 5 of these combo boxes and running all the SQL again. i also thought of passing somesort of variable thro but then i would still need an event for that. any ideals would be awesome

    Read the article

  • How can I move app.config to a different folder inside the Solution Explorer?

    - by Coder7862396
    I'm using Visual Studio 2010. In my Solution Explorer I like to sort my Project items into folders (a folder for Forms, a folder for Classes, a Misc folder, etc.) It seems though that if I move the "app.config" file to a folder named "Config Files" everything works until I change a setting in the Settings.settings file. Once I do that, a new app.config is created and the one that was in the "Config Files" folder did not get updated. I have searched the entire solution for the text "app.config" and did not find any results. How can I move this file so that my Solution Explorer looks nice and clean?

    Read the article

  • Form graphics not set when form loads

    - by Jimmy
    My form has a group box which contains two overlapping rectangles. The form's other controls are two sets of four numeric up down controls to set the rectangles' colors. (nudF1,2,3 and 4 set the rectangle that's in front, and nudB1,2,3 and 4 set the rectangle that's behind.) Everything works fine, except that the rectangles do not display the colors set in the numeric up downs when the form first loads. The numeric up down controls' ChangeValue events all call the ShowColors() method. The form's Load event calls the csColorsForm_Load() method. Any suggestions? namespace csColors { public partial class csColorsForm : Form { public csColorsForm() { InitializeComponent(); } private void csColorsForm_Load(object sender, EventArgs e) { this.BackColor = System.Drawing.Color.DarkBlue; SetColors(sender, e); } private void SetColors(object sender, EventArgs e) { Control control = (Control)sender; String ctrlName = control.Name; Graphics objGraphics; Rectangle rect1, rect2; int colorBack, colorFore; objGraphics = this.grpColor.CreateGraphics(); // If calling control is not a forecolor control, paint backcolor rectangle if (ctrlName.Substring(0,4)!="nudF") { colorBack = int.Parse(SetColorsB("nudB"), NumberStyles.HexNumber); SolidBrush BrushB = new SolidBrush(Color.FromArgb(colorBack)); rect1 = new Rectangle(this.grpColor.Left, this.grpColor.Top, this.grpColor.Width, this.grpColor.Height); objGraphics.FillRectangle(BrushB, rect1); } // Always paint forecolor rectangle colorFore = int.Parse(SetColorsB("nudF"), NumberStyles.HexNumber); SolidBrush BrushF = new SolidBrush(Color.FromArgb(colorFore)); rect2 = new Rectangle(this.grpColor.Left, this.grpColor.Top, this.grpColor.Width, this.grpColor.Height); objGraphics.FillRectangle(BrushF, rect2); objGraphics.Dispose(); } private string SetColorsB(string nam) { string txt=""; for (int n = 1; n <= 4; ++n) { var ud = Controls[nam + n] as NumericUpDown; int hex = (int)ud.Value; txt += hex.ToString("X2"); } return txt; } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } } }

    Read the article

  • Is it possible to add two nodes at a time dynamically to a treeview

    - by Dorababu
    I am having a tree-view on my main form with initially some nodes as follows ACH |-> some.txt |->FileHeader |->BatchHeader Now at this point i will have to add 2 child nodes at a time to BatchHeader. This nodes i will pass as strings from child forms My sample code that i added some nodes is as follows public void loadingDatafrom(string filename, bool str) { if (Append.oldbatchcontrol != filename) { if (tvwACH.SelectedNode.Text == "FileHeader") { tvwACH.SelectedNode.Nodes.Add(filename); } if (tvwACH.SelectedNode.Text == "BatchHeader" && filecontrolvariables.m_gridclick == false) { tvwACH.SelectedNode.Nodes.Add(filename); **I got this idea tvwach.SelectedNode.Lastnode.Nodes.Add("Node");** } } } Can any one give an idea to add 2 nodes as child to the existing node ..

    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

  • C++ Constructor With Parameters Won't Initialize, Errors C2059 and C2228

    - by Some Girl
    I'm a C# programmer trying to muddle through C++ to create a Windows Forms Application. I have a Windows Form that makes use of a user-created class. Basically I'm trying to use a constructor that takes parameters, but my form won't let me initialize the object with parameter. Here's the code, hopefully somebody can explain the problem to me because I'm completely baffled... Here's my header file: BankAcct.h public ref class BankAcct { private: int money; public: BankAcct(); BankAcct(int); void Deposit(int); void GetBalance(int&); }; And my definition file: BankAcct.cpp #include "StdAfx.h" #include "BankAcct.h" BankAcct::BankAcct() { money = 0; } BankAcct::BankAcct(int startAmt) { money = startAmt; } void BankAcct::Deposit(int depAmt) { money += depAmt; } void BankAcct::GetBalance(int& balance) { balance = money; } And finally my main form. Won't copy the whole thing, of course, but I'm trying to declare the new bank account object, and start it with a balance of say $50. private: BankAcct myAccount(50); //does not work! WHY?? //private: //BankAcct myAccount; //works then in the form constructor my code is this: public: frmBank(void) { InitializeComponent(); int bal; myAccount.GetBalance(bal); lblBankBalance->Text += Convert::ToString(bal); } I've included the BankAcct.h file at the top of my frmBank.h, what else am I doing wrong here? It works great if I use the default constructor (the one that starts the bank balance at zero). I get the following error messages: error C2059: syntax error: 'constant' and error C2228: left of '.GetBalance' must have class/struct/union Thank you for any and all help on this one!!

    Read the article

  • In forms application, is there any Alternative to MsgBox?

    - by GuruC
    I like how MsgBox stops all further processing until it's clicked but I don't like how it pops that little msgbox in the middle of the screen, which I then have bring to the front if there is a window covering it. Is there a way to do something like a msgbox but keep it on my Form (which is always in view) so I can go ahead and click a button on the form instead of having to bring the little msgbox window on top of windows that may be covering it. I use the msgbox to inform me that a certain situation has happened, which I manually fix and when I'm done I click the MsgBox to continue processing. It'd be nice to have this button right on the form.

    Read the article

  • Syntax Highlighting in a ListBox

    - by ph0enix
    Hi all, I've searched the web and I can't seem to find anything that will work for me. I've seen plenty of discussion, and even some fairly extensible open-source tools, for code editors that provide line numbers and syntax highlighting. Here's my dilemma... I'm working on a "digital code review" project in C#.NET that allows users to specify source files, add them to a particular session, and other users can make comments and line references to the files being reviewed. Basic requirements: Must be written in C#.NET I don't need to be able to edit the text in the text box Users need to be able to select a line (or multiple lines), to make line references. It seems to me that I need some fancy implementation of a ListBox control (not a drop-down list) that has some OwnerDraw capabilities to add line numbers and syntax highlighting. Unfortunately, I haven't had any luck putting it together myself, and I can't seem to find a control that's already been written or a reference on how I might be able to accomplish this. Any suggestions??

    Read the article

  • How to Disable Alt + F4 closing form?

    - by Aros
    What is the best way to disable Alt + F4 in a c# win form to prevent the user from closing the form? I am using a form as a popup dialog to display a progress bar and I do not want the user to be able to close it. Thanks.

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >