15,881,380 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by niko_tells (Top 33 by date)
niko_tells
21-Feb-13 2:18am
View
Ok i got it, it works like that:
string nameWithoutUnallowedSigns = RemoveSigns.Replace(name, "");
niko_tells
21-Feb-13 2:14am
View
Thank you very much!
niko_tells
21-Feb-13 2:05am
View
Thank you very much!
But i hardly used Regex until now, how do i use it with my string now?
I tried r.Machtes(MyString);
But it seems not legit
niko_tells
3-Dec-12 4:38am
View
i dont think that this gonna work, but nice idea! I need in the AUFK->AUFP table the whole row (if the number exists) from AUFP. AUFK has an "id" and AUFP has an "id", now if the textbox shows one that exists, the datatable(aufp) should fill the rest of informations that AUFP contains. But thank you!
niko_tells
27-Nov-12 2:53am
View
ok im sorry, gonna update it
niko_tells
16-Nov-12 3:15am
View
System.Diagnostics.Process.Start(Path);
niko_tells
16-Nov-12 3:13am
View
And how to open this File? Cause File.Open doesnt really do something..
niko_tells
15-Nov-12 8:40am
View
Updated Question at €:
niko_tells
5-Nov-12 4:26am
View
Thank you mate, now i reccognize what i have done wrong!
Really thanks ;)
niko_tells
5-Nov-12 4:16am
View
Oh solved it, but for my opinion to basic solution.
I deklared a var global -> public string Name;
now in the radiobutton instead of:
string name = ((radiobutton)sender).Name;
this
Name = ((radio....).Name;
and back into the bet button:
Player pls = nPlayer.FirstOrDefault(a => a.Name == Name);
niko_tells
5-Nov-12 4:11am
View
no it unfortunally doesnt work:
private void radioButton_Click(object sender, EventArgs e)
{
// Name or Id
string name = ((RadioButton)sender).Name;
Player pl = nPlayer.FirstOrDefault(p => p.Name == name);
PlID = pl.ID;
if (pl == null)
{
MessageBox.Show("no player");
}
label4.Text = pl.Name;
}
by this i get the label4.text right changed!
and now i have thought i set on form1 the int PlID, wich i get from the radiobutton click, cause the code knows the name of the player.
now i got back to the "bet Button":
private void button1_Click(object sender, EventArgs e)
{
Bet = Convert.ToInt32(numericUpDown1.Value);
Dog = Convert.ToInt32(numericUpDown2.Value);
if (Dog != 0 && Bet != 0)
{
//Here is the problem
Player pl = nPlayer.FirstOrDefault(a => a.ID == PlID);
//MessageBox.Show("" + pl.ID);
pl.BetNow(Wete, nHunde.FirstOrDefault(hund => dog.ID == Dog), pl, Bank);
niko_tells
5-Nov-12 3:56am
View
Ok looks like i have troubles expressing myself, sorry for that!
no i dont have my player, pl is a thought of my friend, and i dont understand why, i think just generated to find it by, like you said, linq
niko_tells
5-Nov-12 3:38am
View
ah not really right, but close!
i solved to get the betting dog like that:
pl.BetNow(Wete, nHunde.FirstOrDefault(dog => dog.ID == Dog), pl, Bank);
everything is working, about dogs, i cant just identify the players.
niko_tells
5-Nov-12 3:25am
View
Question is now updated for more details
niko_tells
22-Oct-12 8:22am
View
Hi Griff,
no there is no financial problem, there is just the problem, if
sth could occur what isnt realy solveable. I just want to know if
you could see xamarin as a real oppertunity for android?
Thats the thing!
Thank you
niko_tells
18-Oct-12 2:30am
View
I have get it like following: Classes are created on basic of "human thinking" like you explained with fields like "age". Ok get it!
With my new knowledge, i would code a "player" class with player proporties. But i dont know what i could put into the bet class? I event dont really know if i need a bet class, cause players could be able to bet with a method of the player class, am i right?
Danke Martin ;)
niko_tells
17-Oct-12 5:18am
View
Thank you Griff! I had an radio Button as you said, set as default in Form Load!
niko_tells
16-Oct-12 3:22am
View
Thank you very much griff for that tipps and support! But im trying all time long finding out why my dog objects all gets the same "random speed"
class: Random Speed = new Random();
run()
{
Position = Speed.Next(1,4);
}
form: Dog Dog1 = new Dog();
and i dont understand why i always get the same random speed
niko_tells
16-Oct-12 2:45am
View
ah i know i have to recode my run method, cause if the dog gets run, it runs until the end, but i have just to tell with run method, go an rnd step forward, and with every tick event this will be repeated!
niko_tells
16-Oct-12 2:03am
View
Never had a better answer, thank you Griff!!!
Just one little problem, how to "set a reference to raceTimer in Form1?"
Very thanks Griff, give you 5 stars and accept question =]
my code now:
private void RUN_Click(object sender, EventArgs e)
{
raceTimer.Start();
raceTimer.Interval = 100;
}
private void Form1_Load(object sender, EventArgs e)
{
Dog1.IMG = IMG1;......
raceTimer.Tick += new EventHandler(raceTimer_Tick);
}
void raceTimer_Tick(object sender, EventArgs e)
{
if (raceTimer.Interval == 100)
{
Dog1.Run(status,50);
}
if (status != true)
{
raceTimer.Stop();
}
}
doggs are stil running one after another..
niko_tells
15-Oct-12 10:34am
View
ok im sorry wasting your time, i will now explaining it. its simple, i just want a programm that tells what dog was first on finish line. Every dog has another speed. I want to write it with classes. But now its the problem that all doggs are running, but not at same time.
Here is the method:
..public Point p = new Point();
public bool run (bool status, int y) //y = y pixels position of images
{
while (status)
{
Position = Rnd.Next(1,4);
p.X +=Position;
p.Y = Y;
IMG.Location = p;
if(IMG.Location.X >= RaceLenght)
{
status = false;
}
Thread.Sleep(10);
}
return status;
}
niko_tells
15-Oct-12 10:13am
View
ok i have solved it on my own, but now the problem is, that dog1 runs first, afterwards dog2 runs when dog1 finished running etc.. until dog 4 ends. how do i initialize 4 objekts at the same time?
niko_tells
15-Oct-12 7:53am
View
Deleted
i dont understand right, i have 4 dogs, and foreach dog is a rnd. so why should this be out of bound??
niko_tells
15-Oct-12 7:34am
View
yes, out of bound at run button: distanz1 = dog1.rnd.Next(1,4) saying that i didnt create an new objekt. But i have -> Dog Dog1 = new Dog(); Also i would prefere dont writing the same for every dog in the runbutton, i would prefere this way more: run button: Dog1.Run(true); Dog2.Run(true);...
niko_tells
9-Oct-12 10:05am
View
haha right, thanks ;)
thanks for helping alot =)
Have a nice day ;)
niko_tells
9-Oct-12 6:45am
View
Thank you for extra explaination for me =)
here is the whole solution:
Point defaultPoint = new Point(1433, 5);
Point MaxPoint = new Point(0, 0);
private void Panel_Extras_MouseHover(object sender, EventArgs e)
{
Panel_Extras.Height = Height;
Panel_Extras.Width = Width;
Panel_Extras.Location = new Point((defaultPoint.X - 20), 5);
}
private void Panel_Extras_MouseLeave(object sender, EventArgs e)
{
Panel_Extras.Height = Height;
Panel_Extras.Width = Width;
Panel_Extras.Location = new Point(defaultPoint.X, 5);
}
private void Panel_Extras_Click(object sender, EventArgs e)
{
Panel_Extras.Location = MaxPoint;
}
There is just one little point, that i dont like, defaultpoint(1433,5) isnt dynamic.
niko_tells
9-Oct-12 5:27am
View
For some reasons its hard to understand you, my english isnt the best -.-
I think you will advice me that i create a variable out of the hover. ex.: int PopX =5
And than entering this variable like that into hover: PanelExtras.Location = new Point((int) (PopX, 0);
I know that this is not possible.
To the comment with width, thank you for that, so i conclused that i need another referenze for width, i tried to get the form1 width but that command is also not possible.
niko_tells
9-Oct-12 4:52am
View
ah i could have the reason why it doesnt increases the width, the panel is on the right border of the window and should increse the size/position to left. So i tried instead of 1.02 -> 0.98. But that doesnt change, its the same funktion like 1.02. I have also tried 10.00, to discover if this is a child of another element and not of form. And 10.00 also didnt change nothing, its like 1.02. Now getting depressed ^^
niko_tells
9-Oct-12 4:41am
View
im not sure if this is "dynamic" cause if i change the window width your code would look crappy
niko_tells
9-Oct-12 4:35am
View
but that aint solved ^^, for the future what should i do if im in that case again? give you 5 stars or mark as solved, even if my thread isnt solved?
niko_tells
9-Oct-12 4:32am
View
Thank you for your very good awnser!
Ok i understand width and height now, but 1.02, 1 stays for increasing, 0 would be for decreasing? .02 is ment by 2%. I wanted to change the value, but it doesnt really change anything, how can i know wich class is based on that?
ps.: if i accept your awnser this thread is solved? if yes, i cant to it, cause there are awnseres open.
niko_tells
9-Oct-12 4:17am
View
if i accept your solution the thread goes solved or you just get points for good awnsers?
niko_tells
9-Oct-12 4:16am
View
following i have tried: private void Panel_Extras_MouseHover(object sender, EventArgs e)
{
Panel_Extras.Height = 750;
Panel_Extras.Width = 40;
Panel_Extras.Location = new Point(1410,0);
}
but thats bad in my mind, cause the window could change his width, this i ment by: new Point and the value 1410. I would ruther prefere to tell them, get window width, and pop +2% out.
Show More