|
Forget that order. I´put it there just to place a breakpoint over it...but...why Application.Doevents is "evil" as you say?
If I found a better option (or an option that could work, at least) be sure that I will take it .
We are talking about 200 records more or less.
|
|
|
|
|
Hi,
As you can see in other responses, Application.DoEvents consumes all kinds of events such as user clicking buttons and can cause unexpected application states. It can also be a very heavy call to make in a loop, since you do not really know what or how much code will be executed. I am not saying never use it but use with extra caution (try not to use it).
I asked for the number of records since you can use a list view in which sorting is very simple. Sorting list view C#
|
|
|
|
|
Much easier. Thanx!
|
|
|
|
|
|
DataGridView control is in Framework 2.0+, not in 1.1 with which I´m developing this App.
|
|
|
|
|
Sorry
|
|
|
|
|
Hi.
I'm having a problem with conflicting namespaces and code that gets autogenerated by the forms designer in Visual Studio 2008. I have search many forums and different documentation, but have not been able to find any solution to this problem.
I have one assembly called Foo.dll with the following namespace/code:
namespace Foobar.System
{
public class MySystemClass() { }
}
Then, I have another assembly which contains som commonly used forms:
namespace Foobar.MyCommonForms
{
public class MyForm : System.Windows.Forms.Form
{
public void SomeMethod()
{
var systemclass = new Foobar.System.MySystemClass();
}
}
}
Here, the compilers display the following error: Type or namespace 'Windows' is not part of namespace 'Foobar.System'. Obviously, the compiler tries to look for the class System.Windows.Forms.Form in namespace Foobar.System.Windows.Forms!
I have been able to solve this by using the alias 'x' instead of 'global' when referencing to the assembly Foo.dll, and declaring extern alias x in my code files, and put 'x::' in front of every reference to types and classes in the namespace Foobar.System. The code compiles.
But it seems that the forms designer don't recognise this, and gives me an error when trying to display the form. This, again, can be solved by manually putting 'global::' in front of every reference to classes in System.Windows.Forms (e.g. global::System.Windows.Forms.Button ), but every time chances are made to the form, the code is automaticaly re-generated, and the 'global::' part is removed.
So, the question is: Is there a way to make the forms designer aware of the alias 'x' that is used to reference my assembly Foo.dll, or is there another, better solution to this? Renaming the namespace Foobar.System to something else is just too much work.
|
|
|
|
|
hi, this sounds realy heavy to me,
but i think you can change the namespace at the project properties to solve the problem.
maybe all namespaces in classes will be renamed (think i saw some like that)..
i think the problem is that the projects name namespace is written in has the same name as the assembly namespace so the windows forms designer implicit thinks that the System namespace comes from YOUR assembly not from microsoft..
i might think totaly wrong but i thought i try to help you with an idea
greetz
|
|
|
|
|
You've got something seriously screwed up in your project. The compiler cannot look for System.Windows.Forms in your namespace. I don't know what to tell you because I can't even replicate the problem in a test project with what you've posted. What are the namespace properties of the project? What namespaces are you importing at the top of the code for each of these??
|
|
|
|
|
I've run into this before. You are correct in that the compiler is looking in Foobar.System.Windows.Forms because you named your namespace 'System'. The local namespace 'System' overrides the global namespace 'System'. I do not know how to get around this. In my case I chose not to name my namespace 'System' but instead named it 'Foundation'. I just wanted to let everyone know that therei s nothing messed up with your project.
|
|
|
|
|
Hi all,
Is it possible to call a function with sending a XML file as XML DOM object.The XML is corrupted(means it contains special characters and will not open in internet explorer)
code is something like this
XmlDocument xmlDoc = new XmlDocument();
--------------------------------
--------------------------------
--------------------------------
xmlDoc.save(path+filename)
bool uploadstatus= functionName(xmlDoc);
public bool functionName(XmlDocument XmlDocToUpload)//is not calling
{
----
----
----
}
Thanks in advance
|
|
|
|
|
hi rakeshs312,
the example you wrote above is possible, you can't send objects direct over tcp or serial port.
you need to get the byte of the XmlDocument.
In your case you have special characters, so you need to convert these character to UTF-8 charset.
(IE doesn't show it because the secial characters are not correct encoded!) take a look at the HTML characters so an open breaked character '<' is in the inner xml not an '<' it would be written as ‹
if you write ÄÖÜ in xml you have the same problem, IE can show this, but the encoding is wrong either.
to solve get the hole Xml from the document as string and convert it to an UTF-8 string or byte array.
hope i could help you
bless
|
|
|
|
|
|
here take a look at System.Web.HttpUtility.HtmlEncode(data) need the System.Web reference!
|
|
|
|
|
Hi!
We have a problem with a program. This program is running 2 years ago and it is used by a lot of users. Some days ago we have had a problem with some users.
When I view a report of crystal report, afert i click escape, the program close without enter in any methods "closing". I have read the msdn that only can happen when there is an applicattion exit. there isn't an applicattion exit in this side. Still debugging i can't do anything because it close all forms.
We think that it can happen with something external to our program, there is something more in the computer... If someone hava a similar problem and can left me an opinion...
Ty
|
|
|
|
|
saldanha22 wrote: there isn't an applicattion exit in this side.
In that case there must be a bug somewhere in the program. It is impossible for anyone here to guess what might be the cause as we have no knowledge of your application. It looks like you have to do some debugging to try and find where it is going wrong.
|
|
|
|
|
if u press f11 key, after the report closed, it move on the disposes of the form's open without enter in the method closing. Is random. Sorry for my bad english
|
|
|
|
|
saldanha22 wrote: if u press f11 key
I (and everybody else here) have no idea what your application does when you press the F11 key. You will have to look at the source code and figure out what debug code to add in order to try and find the error. I know that random errors like this are very difficult to debug, but that is the only solution.
|
|
|
|
|
When i talk about the f11 key i am talking about debug key (i debug the aplicattion line to line with this key). And after do the return, this going to disposes of all forms. It doesnt continue by the stack traces.
|
|
|
|
|
Sorry, but without being in front of your system I cannot offer any further suggestions.
|
|
|
|
|
hello
I asked for a component Changing the Windows Form
|
|
|
|
|
What? Can you be descriptive?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
component for Changing Windows application form
|
|
|
|
|
I'm sorry, english must not be your primary language but please, describe exactly what you want, what you expect it to do, how you expect it to do it, what it is for, and please use more than one sentance to explain all of this.
|
|
|
|
|
Surely he is not talking about the Visual Studio IDE? That is the "component" I use to change windows forms.
|
|
|
|