|
Hi I also look for something like this. Did you find any solution.
I may be very interested to know the result.
What I want to do is exactly use even mstsc or connect with sockets over port 3389 and capture the result in my own application for example in a panel.
|
|
|
|
|
Hello
I got a list of words I need to show the user of my application.
The list is around 1000 words.
I have tried to fill the words in both a listbox and a listview(with view set to detail and 1 columns)
I have a button which refres the data in the list, simply by removing them all and then re-fill them, if the list isnt too long it doesnt bother the user, but if the list is 1000 lines (as in my situation) it takes too long time to enter all the data again.
I thought there might be some alternative to listbox/listview which is made to handle alot of lines?
Otherwise it is probably my code which is wrong, however i'm still in the beginnign phase
To make an easy test I use this funktion (same for-loop to add data to the listview)
private void Test()
{
this.listBox1.Items.Clear();
for (int i = 0; i < 1000; i++)
this.listBox1.Items.Add(i);
}
if anyone got something else I can look up in a book or on the internet to find another way to handle this I would be really happy.
|
|
|
|
|
Hi,
whenever you change a Control's property, it will recalculate itself, redo its layout,
repaint itself, etc since it does not know in advance whether your change is just one
of many, the only one or the last one.
When you want to do a lot of changes, you should consider calling Control.SuspendLayout
at the beginning, Control.ResumeLayout at the end of the massive change.
(or maybe suspend, do a lot, resume, suspend, do another lot, resume, etc).
Some Controls also offer an AddRange() method that acts like a "multiple add"; that too
can result in speed ups (AFAIK it does not make sense to combine both suspend and addrange).
Give it a try on whatever Control suits you most.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks for the good answer
I couldt get the Suspend thing to work, but the AddRange() works perfect
|
|
|
|
|
OK, so I've recently picked up C#. Actually, I knew Jack about it until I dumped some VB code into it, ran some regexs, cleaned up the errors and have finally whittled it down to a total of 16 errors.
I fixed 12 of the "Object reference is required for the nonstatic field, method or property [blah]" but there's 4 left.
In VB it works great with: frmMain.pnlDisplay.Invalidate()
but to fix the CS0120, MSDN basically recommends replacing it with "new frmMain()".
Yeah, great, what that does is creates an infinite loop of new forms being created within one another. It hasn't overloaded any stacks yet but I do have heaps (bad pun) of memory.
Basically I'd like to know how I can access a control on a form from within another class, without having to create new instances and preferably without having to pass references to "this" around everywhere. Or can I get away with in the constructor only?
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Make a method in the other class that accesses its own controls, then call the method from where ever you need to.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Would seem logical I suppose...
Thanks
Wish I'd stuck with VB. *thinks* Wish I knew how to work C# better.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Perhaps not.
Double post, yeah, but I've only just put the change in.
It now reads "Object reference required for nonstatic [...] 'frmMain.paintDisplay()'"
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Are you trying to call this stuff from a static method? Because if so, that'll be the problem. You'd need to make the method not static, or make everything else inside the method static.
Or wait, if your using a static method, pass frmMain as a parameter, and then it should work:
static void myMethod(Form myForm) {
myForm.paintDisplay();
}
...
myMethod(frmMain)
and if your method isn't static, then im not sure. Keep at it though.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Hi,
I'm looking for a code sample in C# or java for bluetooth.
I want to make a simple application for the desktop to log all bluetooth devices that are nearby my bluetooth dongle.
I've been searching for 3 days. So far i can only find code samples for mobile phones.
Thanks in advance!
|
|
|
|
|
|
I have a if statement and a table with 2 atributes. They are description and date. I will check if there is in the table some date like 01-01-2008.
String test "01-01-2008";
if (test.Equals(here I will a SELECT query like SELECT date FROM appointmentTable))
{
textbox1.text = "The description on this date is: " + Here I will the descripton of the selected date
}
Does someone know how I can make something like this in C#?
|
|
|
|
|
You need to do the select statement first, then you can compare the data that comes out. You probably want them both to be date time objects, so you compare the dates and not their string representation.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
There is a screen that appears before a user logs off.
He has to choose whether to log off or switch user.
Or it can be the screen of log off / shut down and etc.
I want to perform some code before this screen appears.
How can I register to the event ?
Thanks,
Clint
|
|
|
|
|
|
What happens when you try it?
Paul Marfleet
|
|
|
|
|
c# dont want to compile it
nemanja
|
|
|
|
|
There's your answer then!
Paul Marfleet
|
|
|
|
|
are you kididng it must be some way to compile it like working with bits and bytes ore such ...
or some lists,arrays, ....
nemanja
|
|
|
|
|
conemajstor wrote: are you kididng
Why would I be kididng [sic]? You asked whether variables names that begin with a number are valid. I suggested that you tried it and observed what happened. You tried it and found that it didn't work. By following an empirical approach, you have answered your own question.
conemajstor wrote: it must be some way to compile it like working with bits and bytes ore such ...
or some lists,arrays, ....
This sentence is nonsense. I have no idea what you are talking about.
Paul Marfleet
|
|
|
|
|
pmarfleet wrote: This sentence is nonsense.
Your terse and highly accurate observation leaves me no choice but to vote your post a 5.
/ravi
|
|
|
|
|
conemajstor wrote: I bet with the teacher that this is possible
You lose.
Not even with the @ identifier specifier does it work:
int @int = 1;
int @1name = 1;
An identifier in C# can never ever start with a digit.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Guffa wrote: An identifier in C# can never ever start with a digit.
Bonus question: can identifier start with digit in IL? (I gave up after maybe 2 min. of googling )
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
I hope you didn't bet too much, or you could end up buying your teacher a Porsche. He's right, and you're wrong. Variables can't start with a number as you found out when you tried to compile it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
but if i enum ??
enum(1a,2a,3a,4a,5a)
nemanja
|
|
|
|