| Remove formatting tag when user make copy and paste into my Winform |
|
 |
Index ‹ Windows Forms ‹ Windows Forms General
|
- Previous
- 1
- Windows Forms General Extremely slow painting on TabControl, GroupBox and Label with transparent back color
I'm using .Net 2.0 and I feel the painting speed of TabControl, GroupBox and Label are extremely slow on a WinXP / Win2K3 with theme enabled.
For example, I create a TabControl and add 3 tab pages. And then I add a GroupBox on a tab page, and add 10 Label into the group box just added, back color of all group box and label are set to transparent.
Copy the group box and paste 9 times on the first tab page, there are 10 group boxes and 100 labels on the first tab page finally. Then I copy all groups boxes and labels to second and third tab page.
When I run the application, and try to switch tab page, it would have 3-5 seconds delay. The application paints the label and group box one by one in very slow speed.
- 2
- Windows Forms General very basic use of combobox
HI
I create this struct to load mi items in the comboBox, so far this is the only way I know to do it.
struct Elemento{
string Text; string ID; public Elemento(string text, string id){ this.Text = text; this.ID = id; } public override string ToString(){
return this.Text;
}
}
then I use this line to load the items
comboBox1.Items.Add(new Elemento(MyItemName, MyItemId));
my question is:
How can I get back the value of an item
I did this but it does not workElemento MyItem;
MyItem = (Elemento )comboBox1.SelectedItem ;
I know Im close but there is something missing.
Is this the best practice to load or use a combobox
thks
- 3
- ClickOnce and Setup & Deployment Projects GenerateBootstrapper questions
Hi;
First off, I have read the following: http://msdn.microsoft.com/msdnmag/issues/04/10/Bootstrapper/ http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvs05/html/custom_pkg.asp http://msdn2.microsoft.com/en-us/library/ms164294.aspx http://www.gotdotnet.com/workspaces/workspace.aspx id=ddb4f08c-7d7c-4f44-a009-ea19fc812545
Sorry for all the questions - there is a lot of content about using the bootstrapper to do X but none I could find about all the properties for anything other than the samples shown. And unfortunately none showed requiring J# (a prerequisite for us).
After reading the above (and some other pages) I have the following questions about using this: 1) Where is complete documentation for GenerateBootstrapper - including what to put in the package.xml to download from Microsoft (not included in the package and not download from us but downloaded from MS if needed): a) .NET 2.0 framework b) .NET 2.0 language pack if appropiate c) J# 2.0 framework d) J# 2.0 language pack if appropiate e) whatever windows setup a wix built msi needs
2) Is there anywhere to get the Bootstrapper Manifest Generator and is it worth using The download link at http://www.gotdotnet.com/workspaces/workspace.aspx id=ddb4f08c-7d7c-4f44-a009-ea19fc812545 does not work.
3) How do I set it to run our msi installer when it is done with the prerequisites And is it embedded in the created setup.exe or downloaded at that time If an option, which is recomended.
4) How do I put out name and text in the dialogs for setup.exe
5) Is this a single file Or is this a set of files that we need to write an installer for
6) Is there a way to make Sql Server Express an option and not show it as an option if Sql Server regular or express (not only express) is already installed
7) Are there any samples of how we should set up our part of package.xml and the rest of our settings - both in our msbuild.proj file and in the xml files that list what goes in to the bootstrapper.
8) Can this be set so that it will look first on disk for the needed install files and then on MS' website so if we put this all on disk we can use the same bootstrapper
8b) And if so, where do we get those files and what is the directory structure
I hope with answers to the above I will have at most 1 - 2 followup questions.
thanks - dave
- 4
- Windows Forms General CheckedListBox.ItemCheck Event
Private Sub ClbDrives_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ClbDrives.ItemCheck
LBoxGames.Items.Clear()
For Index As Integer = 0 To Drives.Length - 1 If e.NewValue = CheckState.Checked Then If Drives(e.Index) <> String.Empty Then LBoxGames.Items.AddRange(Split(Drives(e.Index), "|")) End If End If Next
End Sub
The problem is when I check an Item the Listbox LBoxGames gets cleared and when I uncheck an Item the Listbox LBoxGames gets filled.
LBoxGames is a Listbox Drives is a String() ClbDrives is a CheckedListBox
I am trying to fill a listbox with the strings from Drives but only the ones that corespond with which item's are checked in ClbDrives. For example, if items 0,2,3 and 5 were checked the I would clear the ListBox and add strings 0, 2, 3 and 5 from Drives to the Listbox. I hope it isn't confusing.
I have no idea what I am doing wrong. If somebody knows, please respond.
Thank you, Troy L
- 5
- ClickOnce and Setup & Deployment Projects ClickOnce 3rd party certificate expired
I just recently renewed my signing cert, unfortunately I found out that my clients will needed to uninstall / reinstall the application to get the new signed certificate ClickOnce app. Just for kicks, Does anyone know what happens to an expired certificate with a ClickOnce deployment Does it affect any of the following
1. Clients who have the 'click once' app already installed, get a certificate expired message
2. Does the existing app continue to get updates
3. Do new click once installations work
4. etc.
Bottom line, does it affect any normal operation of the click once app, other than its certificate is just expired
- 6
- Windows Forms General DateTimePicker.Value not updating when using AcceptButton
I seem to be encountering what appears to be a bug in the DateTimePicker Control using VS 2005. Follow these steps:
- Create a new C# Windows Application project
- Drop a DateTimePicker Control and a Button onto the form
- Set the button as the form's AcceptButton
- Add a Click handler for the button
- Set a breakpoint inside the Click handler
- Run the app in the debugger
- Add a watch for the DateTimePicker Control's Value property
- Type a single number over one of the number fields, such as the day or year
- Hit Enter
- Notice inside the Click handler that the DateTimePicker Control's Value property doesn't reflect the change
If I enter two numbers, such as '11' or '06' for the field, and then hit Enter, I don't see the problem. Also, if the field loses focus before I hit the Enter key, all is fine. Formally clicking the button obviously does this and the problem is therefore not seen.
Has anyone seen this before There's not a lot of complexity here, so I'd tend to believe that this is a bug. Assuming it is, does anyone know if this has been reported and is being fixed
Thanks,
mike
- 7
- Windows Forms Data Controls and Databinding Drag and Drop Derived Objects
Hi there.
I have a .Net 2.0 Windows Forms C# app and I am trying to implement drag and drop between 2 datagridview controls.
In the MouseDown on Control#1 I have set the data to be as follows:
DragDropEffects dde = DoDragDrop((ClosingStmt_LineItems)selectedLineItem, DragDropEffects.Move);
Note the selectedLineItem is of the derived type ClosingStmt_LineItems.
How can I get the data back out in Control#2's DoDragDrop method
It looks like the GetData method only handles basic types.
I have tried various attempts at something like this with no luck:
ClosingStmt_LineItems tempLineItem;
tempLineItem = ( ClosingStmt_LineItems)e.Data.GetData("");
I always get tempLineItem = null.
Thanks in advance.
Mike
- 8
- Windows Forms General Refreshing ListBox entries
So I have a unsorted ListBox with its Items field filled with objects that override the ToString() method. But the only way I have found to get the entry in the list box to refresh is to do the following:
MyListBox.Items[ItemIndex] = MyListBox.Items[ItemIndex];
This does infact, call the ToString() method for my object again and refresh the shown string, but it also sets focus on the list box.
Is there a better way to refresh one, some, or all of the displayed strings Is there a way to refresh the displayed strings without setting focus on that ListBox
I mention the fact that the ListBox is unsorted, because if you:
MyListBox.Sorted=!MyListBox.Sorted; MyListBox.Sorted=!MyListBox.Sorted;
Then it will refresh all displayed strings in the ListBox and and not set focus on the box, but the information will endup sorted. And in this case, that is not what I want or need.
Thank you for any help.
- 9
- Windows Forms Data Controls and Databinding How to automatically add child rows when add parent row?
Hi, I've databound an XML file to two different datagridviews connected by a bindingsource so I display the parent in one and child in the other. Now what I want to do is when I add a new row in the parent table, I want to automatically add some data rows in the child table so my XML data structure is preserved. I am guessing I can put it in the UserAddedRow of the datagridview but I can't seem to find the command to add childrows. How can I do this thanx.
- 10
- 11
- Windows Forms General Dual/Multi monitor – Window message
Hi,
I have a scenario where there are dual/multi monitor systems. I have written a nag (like a message box) application, which prompts the users with a message. Now, in a dual monitor scenario this message gets always prompted in the primary monitor of the user.
Is there a way to identify that the user is on the second monitor and prompt the message in the second or the user active screen. It would even help if we can prompt the message based on the mouse cursor position – in a dual monitor scenario.
This is very urgent, kindly help.
Thanks in advance,
Dan
- 12
- 13
- 14
- Windows Forms General C#2005 has events like VBA's Application.EnableEventsHi,
I have a textbox, in my project, I already wrote some functionality which execute during textbox value change in the textbox_valuechange event.
When I try to assign some value to the textbox this textbox_valuechange event is firing.
My problem is I need to prevent this, In VBA I found one Event Application.EnableEvents = false, which usually present events associated with that control and again when we make it as Application.EnableEvents = true, then event firing for control begin to execute like:
VBA Code: Application.EnableEvents = false txtText1.value = "Dotnet" Application.EnableEvents = true
There is any events or method in C#2005, which is equivalent to VBA Application.EnableEvents exists ..
Can anybody help me!.
Regards, ProgGuru.
- 15
- Windows Forms General Auto Close form after time - VB, VS-05
I'm having trouble getting the basic idea of the "Timer" function. I'm using Visual Studio 2005 in a VB environment.
It sounds simple, I have a custom made "about form" and I would like to have it close automatically after a set time period, I guess a timer can do this.
Could someone point me in the right direction
Thanks
Daniel 'fred' Munro
|
| Author |
Message |
easy right

|
Posted: Windows Forms General, Remove formatting tag when user make copy and paste into my Winform |
Top |
Hi,
I want to know if there is a way for disable or remove html formating tag when a user make a copy in or out of my winform and a paste in one of my richtextbox
Because I use some xhtml for different things in my XHTML richtextbox. And so when a user make a copy and paste in my winform I have a lot of formatting markup that I dont want.
So have an idea for do this or a link to explain me how to do that
Thanks
Thierry
Windows Forms30
|
| |
|
| |
 |
nobugz

|
Posted: Windows Forms General, Remove formatting tag when user make copy and paste into my Winform |
Top |
You might get a better answer if you post your question at forums.asp.net. A Windows Forms guy like me would probably use WebBrowser and its Document property to parse the HTML. Or use an XML parser...
|
| |
|
| |
 |
| |
 |
Index ‹ Windows Forms ‹ Windows Forms General |
- Next
- 1
- Windows Forms General Auto log out advice...
Hi, I need some advice/best practice on how to implement the following requirements:
1. I have an MDI application that needs to have an 'auto log out' feature that monitors for a period of inactivity before logging the current user out.
2. It needs to close all windows and display a password screen.
3. It should not attempt to auto log out if any dialog boxes are present or if any MDI child cancels its close event.
I have no problem with the general mechanics of all of this. It's already implemented. The problem I have is the definition of 'period of inactivity' and how to monitor the same.
Activity should include any mouse movement or keyboard press for any non-modal form, including the MDI parent and all children.
My problem is that the majority of my child windows have fully docked components (so the form itself does not see Mouse Move events).
I don't want to have to go through dozens of screens adding MouseMove events all over the place on every control I can think of. There has to be a more economical/effective solution.
What's the best method for this I assume it is to handle incoming WINDOWS WM_XXX messages but I have no experience of doing this in VC#. Or is there a better solution that that
Any help would be most appreciated.
Thanks in advance,
Sigol.
- 2
- Windows Forms General This BackgroundWorker is currently busy and cannot run multiple tasks concurrently.
I have such a message like above when I try to run Background worker again after doing cancel. I though if it was cancelled (CancellationPending == true) - I can run it again but not!
This is a part if code. I guess it is connected with race condition but I do not know how to solve it :-(
private void btnStart_Click(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
private void Run(BackgroundWorker worker, DoWorkEventArgs e)
{
if (worker.CancellationPending)
{
e.Cancel = true;
}
else
{
SomeTimeCounsumingMethod();
}
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
if (worker.CancellationPending)
{
e.Cancel = true;
}
Run(worker, e);
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Error != null)
{
MessageBox.Show(e.Error.Message);
}
else if (e.Cancelled)
{
MessageBox.Show("operation Stopped");
}
else
{
MessageBox.Show("Completed");
}
}
private void btnStop_Click(object sender, EventArgs e)
{
backgroundWorker1.CancelAsync();
}
- 3
- Windows Forms Data Controls and Databinding DataGridView - Auto Gen Columns - But skip certain properties - Help
Hi,
I'm trying to bind a datagridview to a collection class - lets say "OrderLineCollection" that contains a number of "OrderLine" Objects. In this class I have a number of read-only properties (Things like ID) that I don't want to bind, and maybe even some that are read-write that I still don't want to bind.
If I just create a BindingSource and let the grid do things itself, then I get all of the columns from the objects appearing in the grid, and thats kind of what I'd expect. My question is: -
Is there an attribute that I can use on my object property declarations that will prevent the field from being bound automatically ...
I've had a hunt around on the web to see if I can find such a thing but to no avail as yet...
Please don't tell me I have to resort to wrapping this kind of functionality up in my own classes and writing my own attributes etc... etc... 
Thanks - Paul.
- 4
- Windows Forms General How to control another application from a form
Hi all
I am working on a C# project and i need two things...
1-- I want another text editor to open a file but want to keep that editor window under
my form control i.e. as child.... How can I do this
2-- I want to open a command line window (cmd window through a .bat file) and then execute some commands on that but from my windows form... how can i do this. I also want to capture output of the command window after it runns my commands..
Please help
Aamer
- 5
- Windows Forms General Issue calling WebService from Windows Form
Hi all,
My WebService is running on same machine. While adding a web reference through VS.NET if i mention URL of service as http://localhost/MyWebService/Service.asmx and then run the application, Everything is ok. Web Methods are called and response properly.
But if i change URL as http://mymachinename/MyWebService/Service.asmx or Use IP instead of localhost it gives security exception. and no doubt practically my webservice will not be on same machine so in any case i need to mention IP or machine name where webservice is running.
////////////////////////////Error Message/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text ************** System.Security.SecurityException: Request for the permission of type System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken) at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride) at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) at System.Security.CodeAccessPermission.Demand() at System.Net.HttpRequestCreator.Create(Uri Uri) at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) at System.Net.WebRequest.Create(Uri requestUri) at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at MySmartClient.AuthenticationService.Service1.Authenticate(String uname, String pw) at MySmartClient.Login.btnLogin_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) /////////////////////////////////////////////////////////////////////////////////////
Regards, Imran Ghani
- 6
- Windows Forms General Woking with List/Check boxes as well as crystal reports
Hi guys,
Question #1
How do I use list boxes
I have a field inside a form. I want to fill the field from a database table in such a manner that when users click on a particular button in the form, a drop-down list will appear so that they can auto-fill the field from the drop down list.
Question #2
How do I use check boxes
I have a field that I have defined as a checkbox. How do I fill the field with values Example, in the check box, I have two values, 'Yes/No' I want the field be to 'Yes' - checked value. 'No' - unchecked value. Also, I want to set the default to the 'checked' value - 'Yes'
Question #3
Crystal Reports
Generally, I am new in VB/Crystal Report. How do I get started with crystal report Is here the best forum for it
Thanks
- 7
- 8
- 9
- Windows Forms General Change scroll bar style...?
Hi...
Can i change the scroll bar sytle of my form…
I want to change the scroll bar style as same as microsoft’s Live website’s scroll bar…
Can I change like that using my C# application…
Thanks,
Vinay
- 10
- Windows Forms General ListView Mouse button Up
Hi,
How do I manage the ListView control to not handle mouse button up click. The problem is that it seems to handle (Update the listview) both when i press down the mouse button and releases the mouse button.
- 11
- Windows Forms General How can I set a label background color with transparency?Hi,
I would like to know if any possible ways to set the lable background color with transparency Like we set the opacity value for the form. I check the documentation to say that we can set this.lable.backColor = System.Drawing.Color.Transparent; Transparent; However, following this way, the whole label will be invisible in the form. Thanks for your help.
- 12
- ClickOnce and Setup & Deployment Projects VB.NET setup project and automatically registering DLL files?I am trying to make SETUP.EXE file for my service project (not application but service). That is all fine, but now I need that Installer automatically register .DLL files.
For now I put reference in SETUP project with Register vsdraCOM option, but all the installer made is putting the DLL file in the same directory as .EXE file when installation is complete.
Registering .DLL files is not done.
Can you please help me how to make automatically registering .DLL files with installer for VB.NET
Thanks in advance
Regards Gogy
- 13
- Windows Forms Data Controls and Databinding listboxes, bindingsources & many to many relationshiphello,
I am working on a problem tracking winforms smart client application (vs2005).
I
have a form to add a new problem. A problem can affect many customers
and a customer can be referenced in several problems.(many to many
relationship)
i would like to add 2 listboxes : one that would
display all available customers, and one for selected customers for the
current problem.
i would like to use bindingsources for the two
listboxes to manage the edits. using NetTiers, I have entities
representing the Problem & Customer tables.
How can I implement this
thanks
- 14
- 15
|
|
|