Just as you've shown how to write the contents of edit1, change the string you have in your assign file to be the edit 2..
Just as you've shown how to write the contents of edit1, change the string you have in your assign file to be the edit 2..
Its always easier to spot a mistake in someone elses work.
As a kid my parents used to get so frustrated with me, Id write stuff but Im dyslexic and my brain thinks a lot faster than it writes, As as a result Id read what my brain meant to write, not what was on the paper, and Id miss out huge chunks and not see it!
At least if it crashes you should have a good idea why :)
and in vb 6? (something I dont have installed as I wouldnt use it by choice)
It hangs coz you told it to
for (int i = 0; i < 1000; )
{
if (lotteryNumbers[i,0] == randomNumber)
lotteryNumbers[i,1]++;
}
Look carefully at your loop
hmm, it should as the encode64 function has a standard expectation.
Is the result even remotely similar?
Dont re-invent the wheel. Download the function done by someone else
What have you got so far? We dont tend to do your work for you!
MaxLength returns sizes for strings, most others are fixed sizes.
Ah!! I could have sworn your code showed it inside the loop (I did remember saying create a variable in the loop)
Well, happy now.. Dont forget to mark it as solved
OK
its working for me so theres something odd going on.
I made 2 forms, (I didnt rename anything its a hack its ugly and you just have to go with it)
first form is blank!
second form has 4 buttons on
and the following code
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("button1");
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("button2");
}
private void button3_Click(object sender, EventArgs e)
{
MessageBox.Show("button3");
}
private void button4_Click(object sender, EventArgs e)
{
MessageBox.Show("button4");
}
So..
My code then in the creation of form1 was..
Form2 f2 = new Form2();
f2.Show();
foreach (Button b in f2.Controls)
{
Button x = b;
Button nb = new Button();
nb.Name = b.Name;
nb.Parent = this;
nb.Top = b.Top;
nb.Left = b.Left;
nb.Height = b.Height;
nb.Width = b.Width;
nb.Text = b.Text;
nb.Click += delegate(object ssender, EventArgs se) { Text = ((Button)x).Text; x.PerformClick(); };
}
So
on running, I get 2 forms, both with 4 buttons
If I click button4 on form1 (the button made on the fly) it pops up button4, just like it would if I had clicked button4 on form2, similarly i get button1 if I click button1.
So the process should be working as I described. and expected..
Make the test app for yourself, it should work..
Hmm, I get what they said, but thats not entirely true. As a new variable is created each time the loop goes through - which is why the variable had to be inside the loop not outside - otherwise Id wholeheartedly agree.
For example:
Crearte an empty app
Create 2 buttons
Create an edit box
in the event of the first button do
String a = textBox1.Text;
button2.click += deligate (object ssender, EventArgs se) { messagebox.Show(a); };
enter a click button1, enter b, click button1
click button2
you'll now get a and then b in messageboxes. thus showing that the variables stayed within the anonymous methods.
Im almost possitive ive used this to keep hold of random objects
Im now at work I got a bit of stuff to do - as much as you guys might find it funny, Im not currently employed as a developer :P I have been, was for many years, but not currently.. I do something else. It needs doing, and after all they pay me to do it..
You give that a go, and see what I mean, and I'll try and work out a way round it.. There has to be one!
hmm, try dropping the
toolstripmenuitem = new ToolStripMenuItem();
As you are creating space you dont need.. Other than that, that should work..I'll experiment more when I get to work
Thats because its looking for one called "Edit" ... it is case sensitive other issues can be you may need to check the name you gave it, as well as if checkbox is in a panel and the edit is in another, then the .parent wont be sufficient
Can you then post the whole code, as it should indeed be working.
Does it work now?
a variable is a direct reference to a specific item.. where as the non variable kind is a reference to something thats changing. if that makes any sense
Ok did you try instead of repeatdly referencing the (ToolStripMenuItem)menuitem) make a variable in your foreach loop and use that?
You can do a test app with buttons and text boxes and it most certainly will and should work
What Im doing is creating an event on the fly and telling it to click the toolmenuitem in question.
The only difference between you and me is I assigned a variable to my item, so rather than keep referencing ((ToolStripMenuItem)menuitem) I had assigned it as a variable, try that, as it most certainly does and should work.
I dont believe you can retrieve deligates assigned to an event, however, i would have thoguht you could cheat! And make an anonymous method that would work something like:
RowHeaderMenu.MenuItems.Add(((ToolStripMenuItem)menuitem).Name, delegate(object ssender, EventArgs se) { ((ToolStripMenuItem)menuitem)..PerformClick(); });
He tries to with his
seek(UserFile, filesize (UserFile));
For short, there is no such thing "putting in the name". You must have a reference (memory address) of the object you're going to use. When you say you put in the name of something, it may be a name of a global (like Form1) holding the reference for that object, or a field of the form which has that method (like writing Button1, it's like Self.Button1). The earlier case is just nc (globals=deprecated), and the later is a valuable shortcut set up for you by the IDE. But then if you use a field of an object, you must have a source code of it in the same file or in the uses clause to allow the compiler to calculate the offset of that field related base address.
thank you for your pedantic post, putting the name of the component in is not an unrealistic question - it hadnt been mentioned before it was created on the fly - hence it seemed that the issue was being over complicated.
Ive been coding in delphi for over 20 years, I can assure you I know more than well the name of the component is for my convienience not the computers.. In fact I feel at this point, if you look in the special thanks of delphi 2006, 2007 you'll find my name there, similarly its in the team for 2009.. So, believe me I do know what Im talking about - I just was asking a simple question and …
You mean call this?
CheckBox.OnClick := DisableEditBox(EditBox);
And then disable the EditBox in the method? I've tried every possible combination, it always says there's a type mismatch when compiling the code. Or did I misunderstand you?
No but the Checkbox_OnClick method could just say
Editbox.Enabled:=false;
You seem to be over complicating what you want to do
This is going to sound stupid but why cant you just put the names of the components in the original click method and enable/disable them?
Use grep and look you'll find somewhere in one of the files the paths have been embedded
I would say call Edit.Click but edit boxes dont have such a function
If you know the control you want, make a routine you pass the edit box too, and call the routine with that from your onclick method.
If you need something else to see them they have to be public.
Try disabling the picturebox.
Your question is unclear because you have used lots of caps and no punctuation, and barely described the issue.
However..
I believe most of the code you posted is unnecessary, bar the "newuser1" function
But, Im guessing the main part is you need to check your seek worked, and th at you moved to the right point..
Hmm, I'll have to mail the person ask why its not working..
PS http://www.xcalibur.co.uk/training/Delphi2005 is working now!
On click needs a procedure assigned to it so if you have
procedure mything.something_click(Sender : TObject)
begin
.. do something
end;
button1.Onclick = something_click;
Sure, define your own class descending from the original, and then you can
a) allow the original to draw as was and draw over the top
b) add properties and data of your own
Part of it is done because a lot of services are running as a service account that has admin access with no questions and so any "user" who can interact with that potentially has more rights than they should
Other reasons are that because services have no session like a user would, you need to be careful as to who would be controlling something if a service were to appear on more than one session..
I believe by default vista doesnt allow it, and certainly GPOs are applied in a lot of companies/organisations (unis etc) to prevent any exploitation.
You would need a separate application - as a rule a lot of machines are set so that services dont and cant interact with the desktop, as a result the service wont even run if it has forms in it.
You have to establish some form of communication protocol so that your application running in the systray and your service can talk without being the same thing.
What are you connecting to? Does it need line feeds at the end of your Send before it will respond?
Its possible that doing it in the initialize component section may not be helping, but.. normally I wouldnt use this.MyVideo_Ending, it would just be MyVideo_Ending
Delphi isnt old, however, inno setup is more the key here, rather than delphi itself, as thats where the code was being used.
The font size and type is user preference, Im not sure you can override it without making a fake console looking app.
try Exists() then. theres one for each
Not found IsFile or IsDirectory functions I guess then
Ok, but the reason it doesnt change is as you move through one table you have to tell the listbox that you've changed value..
If you look you your dataset designer, you'll find you can relate tables, see if that helps.
Check the type wether its a file or a folder :)
Yes
TCheckbox is a TYPE, Checkbox1 or whatever is an instance of that type..
You shouldnt need to check that the send is of type checkbox, if you only assign the procedure to a checkbox, then its gonna be one.. and its not the sender you are worried for really - however.. If you want more explaination.. theres a tutorial at http://www.xcalibur.co.uk/training/Delphi2005 (dont be surprised at the 2005, its been updated since then) and you'll find it covers exactly this kind of thing.
checkbox1 would be the default name for the first checkbox dumped on your form.. so if they gave you the answers Im confused why you need to ask..
Right click references, select the DLLs you want either from the predone list or your own.
You dont have to do each of the test conditions in different ifs, eg..
you can do
if (!String.IsNullOrEmpty(strAssigneeEmail) &&strAssigneeEmail != "donightreply@dimtpa.com")
{
//
}
However, one thing that does strike me is that in your case above as long as assigneeemail isnt empty and doesnt equal the donot reply address, its going to have added the requester email and the assignee email irrelevant of wether the requestermail is empty or not.
My view?
pseudo code:
If both are not null or empty & assigneeemail isnt donot reply then add them both and build user list..
otherwise
whine it wasnt right.
1 big if and 3 items if it passes 1 if it fails.
Case statements as a rule usually take the form
test value is x
if test is 1 do this and end
if test is do this and end
if test isdo this and end
othewise do the this and end
end test.
rest of code..
Your test there is asking different questions, and would only cover 1 aspect should anything go wrong. Eg,
!string.IsNullOrEmpty(strRequesterEmail) & (strAssigneeEmail != "donotreply@dimtpa.com" & !string.IsNullOrEmpty(strAssigneeEmail)
If that was true and it added the 2 parts listed, that would be it, it wouldnt then go on to do the rest. Which in that case might be ok, but for the single parts you would then have to additionally test which one or neither happened.
For this instance Id suggest some if statements, but Id also create a flag at the top to test if all aspects were set, eg a requester and an assignee. As if those 2 parts are not filled in, your email wouldnt be vaoid anyway.
Your case statement reads like this
test nothing
if something_1 is a value then do this
if something potentially totally unrelated is a value then do this..
end test..
This isnt what case statements were really designed for..
They are much more..
// WARNING FAKE CODE
Menu option? valid 1-9 get option
switch option
{
case 1 : do menuoption1
case 2 : do menuoption2
...
default : do …
But there are.. type it in and press F1 it tells you and has examples for nearly everything - failing that type it in google! Theres so much information there right at your fingers, if you cant be bothered to try looking for yourself, it seems wrong for you to be expecting others to do it for you.
Yes and no, unless you fancy getting your educational reward (eg school certificate, diploma etc) to us, you need to learn for yourself, we dont do your work for you, we will help you with it. Reading something as simple as what keywords mean and so on, is something you really really need to do for yourself.. You're the one in education after all, not me. I did my bit, and how did I learn? I taught myself, other than its pointless me copy and pasting an answer or explaining it in my own words when you could read it and find it yourself in information you already have.
then you need to read more :)