|
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
|
|
|
|
|
Enum members are not variables, and even those identifier cannot start with a number.
Had you tried it yourself, you would have found out quite easily.
But, in either case, you still lose...
|
|
|
|
|
conemajstor wrote: I bet with the teacher
Do you have a gambling problem? That's like betting on a three legged dog!
|
|
|
|
|
my teacher is one peace of sh*t ... im 92' and i am programming 5 years now and he teaches me whats a computer .. how to switch it off , on, het yells to me when i am not listening him .... and this question is for Pascal but i havent found pascal forum ... we learn pasacl becaues my teacher is 65 years old and dont know anything other .... i won 3 bets allready from him!!!!
nemanja
|
|
|
|
|
My sympathys are with your teacher. You don't listen to him, and you still haven't learned your lesson.
conemajstor wrote: won 3 bets allready from him
But not this one.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
conemajstor wrote: im 92'
You are ninety-two feet? Or did you perhaps mean '92?
conemajstor wrote: i am programming 5 years now
Oh, a newbie.
conemajstor wrote: het yells to me when i am not listening him
Go figure...
conemajstor wrote: we learn pasacl
That's good. Pascal is an excellent language for learning programming.
conemajstor wrote: becaues my teacher is 65 years old and dont know anything other
I seriously doubt that.
conemajstor wrote: i won 3 bets allready from him
So now you think that you know anything?
---
"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
|
|
|
|