Search Results

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

Page 36/113 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • How can we copy the data of the datacolumn of the datatable to another datatable ?

    - by Harikrishna
    How can we copy one datacolumn with data from one datatable to another datatable ? I have datatable like DataTable datatable1=new DataTable(); and there are four columns in that table but I want only one column.So I am doing like DataTable datatable2=new DataTable(); addressAndPhones2.Columns.Add(addressAndPhones.Columns[0].ColumnName,addressAndPhones.Columns[0].DataType,addressAndPhones.Columns[0].Expression); but this just adds the column but I want to copy the data for that column to the datatable2.That is I want to copy the datacolumn with data from one datatable to another datatable.

    Read the article

  • How to honor/inherit user's language settings in WinForm app

    - by msorens
    I have worked with globalization settings in the past but not within the .NET environment, which is the topic of this question. What I am seeing is most certainly due to knowledge I have yet to learn so I would appreciate illumination on the following. Setup: My default language setting is English (en-us specifically). I added a second language (Danish) on my development system (WinXP) and then opened the language bar so I could select either at will. I selected Danish on the language bar then opened Notepad and found the language reverted to English on the language bar. I understand that the language setting is per application, so it seemed that Notepad set the default back to English. (I found that strange since Windows and thus Notepad is used all over the world.) Closing Notepad returned the setting on the language bar to Danish. I then launched my open custom WinForm application--which I know does not set the language--and it also reverted from English to Danish when opened, then back to Danish when terminated! Question #1A: How do I get my WinForm application upon launch to inherit the current setting of the language bar? My experiment seems to indicate that each application starts with the system default and requires the user to manually change it once the app is running--this would seem to be a major inconvenience for anyone that wants to work with more than one language! Question #1B: If one must, in fact, set the language manually in a multi-language scenario, how do I change my default system language (e.g. to Danish) so I can test my app's launch in another language? I added a display of the current language in my application for this next experiment. Specifically I set a MouseEnter handler on a label that set its tooltip to CultureInfo.CurrentCulture.Name so each time I mouse over I thought I should see the current language setting. Since setting the language before I launch my app did not work, I launched it then set the language to Danish. I found that some things (like typing in a TextBox) did honor this Danish setting. But mousing over the instrumented label still showed en-us! Question #2A: Why does CultureInfo.CurrentCulture.Name not reflect the change from my language bar while other parts of my app seem to recognize the change? (Trying CultureInfo.CurrentUICulture.Name produced the same result.) Question #2B: Is there an event that fires upon changes on the language bar so I could recognize within my app when the language setting changes?

    Read the article

  • C# settings using ApplicationSettingsBase - roaming and common

    - by Mark Pim
    I'm using the Windows Forms Application settings architecture (or however you're supposed to refer to it) and am successfully saving user settings to AppData. What I want to do is have some settings common to all users of a particular machine and some settings which roam with users across machines. For example I have some settings relating to a peripheral attached to the computer (model, settings etc.) and some user preferences like user interface colours. The colours preferences should roam with the user, but the peripheral settings should stay on the local computer no matter who's logged on. How can I mark these types of settings so that some get stored in /AppData/... and some in /AppData? Note that I don't want Application level settings - each computer the app will be installed on will have different settings. I'm targetting .Net 3.0 if that makes a difference.

    Read the article

  • Which type of file parsing easiest and efficient and good ?(html,pdf,csv,text)

    - by Harikrishna
    I want to parse the html file, pdf file, csv file and text file. Now parsing for which type of file (specified above) is easiest and efficient ? Like parsing for html file is easiest and efficient OR parsing for pdf file is easiest and efficient OR parsing for csv file is easiest and efficient ? I am asking this question because I want to parse pdf ,html ,csv and text file through common parsing code if possible. And now suppose if parsing for html is easiest and efficient then : I will write the parsing code for html file and will try to convert pdf file to the html file(if possible)so the code written for parsing html file will also work for pdf file also. And thus I will try to convert pdf,csv and text file to html file.And write the code for parsing html file and thus this code will parse html,pdf,csv and text file. Suppose if parsing for pdf is easiest and efficient then : I will convert html,csv and text file to pdf and write the code for parsing pdf file.So the code for parsing pdf file can parse html,csv and text file. So my question is (1) Which type of file parsing is easiest and efficient (pdf,csv,html,text) ? (2) And converting files(pdf,text,html,csv) to eachother is possible. Like if html parsing easiest then pdf to html,text to html and csv to html.

    Read the article

  • Winform User Settings - Allow multiple choice values at Runtime

    - by Refracted Paladin
    I created a simple User Settings Dialog by binding the Property.Settings to a PropertyGrid. This works like a charm but now I would like to allow only certain choices for some values. I have noticed that some Types will give a dropdown of possible choices. This is what I am shooting for but for, say, Strings. Example, one of the Settings is UserTheme which is a String. Black, Blue, Silver. The program reads that string from the Settings File and sets the Theme on Startup. I can type in a correct theme and it works but if I type in Pink it will not as there is not a pink option. This is my VERY simple UserSettingsForm code. #region FIELDS internal Settings userSettings; #endregion #region EVENTS private void frmEditUserControl_Load(object sender, EventArgs e) { userSettings = Settings.Default; this.propertyGrid1.SelectedObject = userSettings; this.propertyGrid1.PropertySort = PropertySort.Alphabetical; } private void btnSave_Click(object sender, EventArgs e) { userSettings.Save(); //this.DialogResult = DialogResult.OK; this.Close(); } private void btnCancel_Click(object sender, EventArgs e) { userSettings.Reload(); this.Close(); } #endregion

    Read the article

  • Listview with copy-paste

    - by Zubirg
    Hi, Is there an easy way of adding copy-paste for a listview, or should I just switch to DataGridView instead? My application is kinda like an address book, it contains emails, numbers etc where copy paste would be useful.

    Read the article

  • How to determine if DataGridView contains uncommitted changes when bound to a SqlDataAdapter

    - by JYelton
    I have a form which contains a DataGridView, a BindingSource, a DataTable, and a SqlDataAdapter. I populate the grid and data bindings as follows: private BindingSource bindingSource = new BindingSource(); private DataTable table = new DataTable(); private SqlDataAdapter dataAdapter = new SqlDataAdapter("SELECT * FROM table ORDER BY id ASC;", ClassSql.SqlConn()); private void LoadData() { table.Clear(); dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = bindingSource; SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter); table.Locale = System.Globalization.CultureInfo.InvariantCulture; dataAdapter.Fill(table); bindingSource.DataSource = table; } The user can then make changes to the data, and commit those changes or discard them by clicking either a save or cancel button, respectively. private void btnSave_Click(object sender, EventArgs e) { // save everything to the displays table dataAdapter.Update(table); } private void btnCancel_Click(object sender, EventArgs e) { // alert user if unsaved changes, otherwise close form } I would like to add a dialog if cancel is clicked that warns the user of unsaved changes, if unsaved changes exist. Question: How can I determine if the user has modified data in the DataGridView but not committed it to the database? Is there an easy way to compare the current DataGridView data to the last-retrieved query? (Note that there would not be any other threads or users altering data in SQL at the same time.)

    Read the article

  • Form for Telerik RadRibbonBar?

    - by Cyclone
    I got the Telerik RadRibbonBar for free with the Express edition of vb a while back, but it did not come with any sort of form. It also, unfortunately, has the control buttons there automatically. How would I create a form which is resizable, and works like a standard winform, but doesn't have the top bar? I tried: FormBorderStyle = Sizable Text = Nothing ControlBox = False Unfortunately, when you maximize the window, it goes in front of the taskbar...and it has an ugly border when it isn't maximized. How can I: Change border color? Make it so it does not go in front of the taskbar? Thanks for the help! I'm surprised there is not some sort of form already made for this.

    Read the article

  • WinForm PDF viewer with programatic search functionality

    - by Anthony Shaw
    We are currently using PDFTron's PDFView WinForm control to view PDF's in a WinForm application. I can load the file and search the file to highlight a certain text value. We have run into an issue where we have expired our trial license period and do not wish to shell out the $900/seat licensing on 15-20 computers. Does anybody know if the ActiveX Adobe Reader control can support the searching functionality programatically? I've tried that and the FoxIt Reader OCX control and neither seem to have this feature exposed (unless it's hidden really well) Does anybody have any suggestions for other freeware/open source viewers, or less-expensive viewers? TIA!

    Read the article

  • Can not parse tabular information from html document.

    - by Harikrishna
    I am parsing many html documents.I am using html agility pack And I want to parse the tabular information from each document. And there may be any number of tables in each document.But I want to extract only one table from each document which has column header name NAME,PHONE NO,ADDRESS.And this table can be anywhere in the document,like in the document there is ten tables and from ten table there is one table which has many nested tables and from nested table there may be a table what I want to extract means table can be anywhere in the document and I want to find that table from the document by column header name.If I got that table then I want to then extract the information from that table. Now I can find the table which has column header NAME,PHONE NO,ADDRESS and also can extract the information from that.I am doing for that is, first I find the all tables in a document by foreach (var table in doc.DocumentNode.Descendants("table")) then for each table got I find the row for each table like, var rows = table.Descendants("tr"); and then for each row I am checking that row has that header name NAME,ADDRESS,PHONENO and if it is then I skip that row and extract all information after that row foreach (var row in rows.Skip(rowNo)) { var data = new List<string>(); foreach (var column in row.Descendants("td")) { data.Add(properText); } } Such that I am extracting all information from almost many document. But now problem is sometimes what happened that in some document I can not parse the information.Like a document in which there are like 10 tables and from these 10 tables 1 table is like there are many nested tables in that table. And from these nested tables I want to find the table which tabel has column header like NAME,ADDRESS,PHONE NO.So if table may be anywhere in the document even in the nested tables or anywhere it can be find through column header name.So I can parse the information from that table and skip the outer tabular information of that table.

    Read the article

  • C# UserControl Validation

    - by Barry
    Hi, I have a UserControl with a Tab Control containing three tabs. Within the tabs are multiple controls - Datetimepickers, textboxes, comboboxes. There is also a Save button which when clicked, calls this.ValidateChildren(ValidationConstraints.Enabled) Now, I click save and a geniune validation error occurs. I correct the error and then click save again - valdiation errors occur on comboboxes on a different tab. If I navigate to this tab and click save, everything works fine. How can this be? I haven't changed any values in the comboboxes so how can the fail validation then pass validation? The comboboxes are bound to a dataset with their selectedValue and Text set. I just don't understand what is happening here. This behaviour also occurs for some textboxes too. The validation rule is that they have to be a decimal - the default value is zero, which is allowed. The same thing happens, they fail validation the first time - I make no changes, click save again and they pass validation. If you need any further information please let me know thanks Barry

    Read the article

  • VB.Net Custom Object Master-Detail Data Binding

    - by clawson
    Since beginning to use VB.Net some years ago I have become slowly familiar with using the data binding features of .Net, however I often find my self bewildered by it's behavior and instead of discover the correct way it should work I find some dirty work around to suit my needs and continue on. Needless to say my problems continue to arise. I am using Custom Objects as the Data Sources for by controls and often entire forms. I find it frustrating to separate business logic and the graphical interface. (That could be a new question entirely.) So for a lot of objects I generate a form which has the DataBindingSource for the object. When I create each from using the New Constructor I explicitly pass to it the object to which it should be bound, and then set this passed object as the DataSource of the BindingSource. (That's a mouthful!) Now the Master object (say, bound to each form) often contains a List of objects which I like to have displayed in a DataGridView. I (sometimes) create and modify these child objects in their own form (again creating a databind the same way as the master form) but when I add them to the List in the master object the DataGridView won't update with the new items. So my question really has a few layers: How can I easily/efficiently/correctly update this DataGridView with the list of Detail objects when I add them to the list of the Master object. Is this approach to DataBinding good/viable. What's the best way to separate business logic from graphical interface. Thanks for the help!

    Read the article

  • Treeview does not refresh to show childnode moved from one parent node to another

    - by mike
    I am using the Windows Forms TreeView class which contains a set of TreeNodes. The TreeNodes can have child nodes. I have a root node with 2 sub nodes (Node1 and Node2) Node1 has 2 subnodes (child1 and child2) I have a function that will allow a user to select any node and move it to another node: TreeNode SelectNode = this.TreeView1.SelectedNode; TreeNode DestNode = SelectedNewNode(); //function to select a new node SelectedNode.Remove(); DestNode.Nodes.Add(SelectedNode); this.TreeView1.Refresh(); When this executes, the current selected node (child2) is removed from its current parent (Node1) and added to Node2. However, the Refresh() method of the TreeView control does not show that child2 is under Node2. If I debug it and look at the Nodes collection in the TreeView i do see that child2 is under Node2. Can anyone tell me why the Refresh() method does not redraw the new parent to child mapping? Is there a way to tell the TreeView to redraw with the new mappings?

    Read the article

  • Windows forms application blocks after station lock

    - by Silviu
    We're having a serious issue at work. We've discovered that after the station where the client was running is locked/unlocked the client is blocked. No repaint. So the UI thread is blocked with something. Looking at the callstack of the UI thread (thread 0) using windbg we see that a UserPreferenceChanged event gets raised. It is marshalled through a WindowsFormsSynchronizationContext using it's controlToSend field to the UI. It gets blocked by a call to the marshalling control. The method called is MarshaledInvoke it builds a ThreadMethodEntry entry = new ThreadMethodEntry(caller, method, args, synchronous, executionContext); This entry is supposed to do the magic. The call is a synchronous call and because of that (still in the MarshaledInvoke of the Control class) the wait call is reached: if (!entry.IsCompleted) { this.WaitForWaitHandle(entry.AsyncWaitHandle); } The last thing that i can see on the stack is the WaitOne called on the previously mentioned AsyncWaitHandle. This is very annoying because having just the callstack of the runtime and not one of our methods being invoked we cannot really point to a bug in our code. I might be wrong, but I'm guessing that the marshaling control is not "marshaling" to the ui thread. But another one...i don't really know which one because the other threads are being used by us and are blocked...maybe this is the issue. But none of the other threads are running a message loop. This is very annoying. We had some issues in the past with marshaling controls to the right ui thread. That is because the first form that is constructed is a splash form. Which is not the main form. We used to use the main form to marshal call to the ui thread. But from time to time some calls would go to a non ui thread and some grids would broke with a big red X on them. I fixed this by creating a specific class: public class WindowsFormsSynchronizer { private static readonly WindowsFormsSynchronizationContext = new WindowsFormsSynchronizationContext(); //Methods are following that would build the same interface of the synchronization context. } This class gets build as one of the first objects in the first form being constructed. We've noticed some other strange thing. Looking at the heap there are 7 WindowsFormsSynchronizationContext objects. 6 of these have the same instance of controlToSend, and the other one has some different instance of controlToSend. This last one is the one that should marshal the calls to the UI. I don't have any other idea...maybe some of you guys had this same issue?

    Read the article

  • Cannot delete an image file that is shown in a listview

    - by Enrico
    Hello all, In my listview I show thumbnails of small images in a certain folder. I setup the listview as follows: var imageList = new ImageList(); foreach (var fileInfo in dir.GetFiles()) { try { var image = Image.FromFile(fileInfo.FullName); imageList.Images.Add(image); } catch { Console.WriteLine("error"); } } listView.View = View.LargeIcon; imageList.ImageSize = new Size(64, 64); listView.LargeImageList = imageList; for (int j = 0; j < imageList.Images.Count; j++) { var item = new ListViewItem {ImageIndex = j, Text = "blabla"}; listView.Items.Add(item); } The user can rightclick on an image in the listview to remove it. I remove it from the listview and then I want to delete this image from the folder. Now I get the error that the file is in use. Of course this is logical since the imagelist is using the file. I tried to first remove the image from the imagelist, but I keep on having the file lock. Can somebody tell me what I am doing wrong? Thanks!

    Read the article

  • Rich Text Editing in Windows Forms

    - by fawad
    I am using following text editor for my windows forms application http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx This works great and a wonderful control, however I am trying to accomplish one task i.e. I wanted to insert a custom tag to the underlying html for eg if user clicks on a button on form I want to insert a tag <myTag>value</myTag>" at the cursor's position of text editor. Can anyone guide me how to achieve this?

    Read the article

  • How to programmatically detect Cipher type and Encryption level from a wireless network device from

    - by amexn
    Now my team working in a network project using windows application c#. I didn't know how to programmatically detect Cipher type and Encryption level from a wireless network device from windows 2003 server. After searching i got WMI (Windows Management Instrumentation) for solving the problem.+ Please suggest example/reference for finding Cipher type and Encryption level from a wireless network device from windows 2003 server

    Read the article

  • Sort a data grid based on a specified column.

    - by o vamsi krishna
    Developed a winform project using VB 2008. I'm using a .xls sheet as source. My appln has 7 columns and unspecified rows. I want to sort all the columns based on a specified column and allot a serial number as per the sorted order. If two items in the specified column are same we should consider another column for the equal items and sort them in that order. plz help me in this issue.

    Read the article

  • How to change default image of derived ToolStripButton?

    - by Special Touch
    It seems like a simple task. Create a C# class that derives from ToolStripButton. The derived ToolStripButton should behave exactly the same as the parent class in the designer and the application, except that the default image should be different. Surprisingly just changing the constructor is not sufficient: public CustomToolStripButton() { base.Image = (Image) new Bitmap(typeof(CustomToolStripButton), "CustomImage.bmp"); } When the ToolStripButton is displayed in the designer, the original default image is shown. There must be a simple solution. What could it be?

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >