|
tnx for the replies dudes,now i have another problem,i have the single exe appllcation,but i only runs where the OS has dotnet framework 2.0,i want my application to run in any computer that has windows xp or vista.without no need to install dotnet framework.i will be thankfull if u have any idea.
|
|
|
|
|
Not possible. Kind of the whole point of a framework...
Me fail English? That's unpossible!
|
|
|
|
|
hello all
i have troubles with the following code
there are two forms
Form1 and Form2
Form1 is the owner of Form2
i need to move label1.text from Form2 to Form1 (note: both forms are running and visible)
here is my code
Form1 F1 = (Form1 )this.Owner;
F1.textbox1.text = label1.Text; // i had set textbox1 modifier property to public
thanks in advance
|
|
|
|
|
Mr.Kode wrote: Form1 F1 = (Form1 )this.Owner;
F1.textbox1.text = label1.Text; // i had set textbox1 modifier property to public
This should work, although it's probably the nastiest code I've seen today ( and that's huge ).
1 - why on earth can't anyone here give their variables meaningful names ? Form1 ? Label1 ? Are you all REALLY comfortable with that ?
2 - making your controls public is retarded. If you must, make a string property public that sets the text on the label, but don't expose the whole thing. If your doctor asks to see the back of your knee, do you take all your clothes off ?
3 - you say 'I have troubles' then you post code that looks like it should work. What troubles ? What's happening ? Does it run ? Does it blow up ? If you want to ask a question, you need to be CLEAR
4 - the best way to communicate between forms is delegates. Then no properties need to be exposed.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: If your doctor asks to see the back of your knee, do you take all your clothes off ?
Depends on the doctor.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Good call.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks Christian ..
but i am still suffering
error null reference exception was unhandled
|
|
|
|
|
What line gives you the error ? Did you change your code completely to get rid of all the stuff I said was retarded and use delegates ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
F1.textbox1.text = label1.Text;
the exception fires on that line
i`ll try to delegate that ,but for now i need to solve the problem
|
|
|
|
|
Well, it would help if you knew what you were doing. I assume you have no idea what object is null ? Do you have any idea how to use the debugger ? Hit F9 with the focus on this line to set a breakpoint, hit F5 to debug and when the code stops on this line, you can hover over each object. Either F1 is null ( which seems unlikely as you cast it and don't use 'as' ), label1 is null ( unlikely as it's a local object ) or textbox1 is null. Once you work out which is null, you can work out why. Do you set the Owner of the form when you create it ? That may be the problem.
Mr.Kode wrote: but for now i need to solve the problem
Why ? This is surely not code that someone is going to use in real life ? It's a disaster, as I said.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks Christian
i found where the error is
i forget that f1 have mdiparent to another form
but i want to know why i can`t set mdiparent and owner at the same time?
|
|
|
|
|
Because the owner exists entirely to create a relationship in terms of how the form is shown, and it's invalid if it's got an MDIparent instead.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
where you wrote this code?? under form1 or under form2?
what you really want do?please describe in details...
|
|
|
|
|
dude i think ur trying to move a string(lable1.text) from form1 to form2,it's easy.
for example u want have a button,when clicked u want to show second form.
form2 f2=new form2();
ok,now goto ur form2.cs code view,in the first lines u c something like this:
public form2()
{
initializecomponent();
}
now change the arguments that form2 needs,in the code above,u c that second form doesn need anything for being instanced,change it like this:
public form2(string labltext)
{
...
}
now when u want to make an instance of the second form,pass the string in that way:
form2 f2=new form2(label1.text)
in second form u can access the string throw variable labltext.
have fun
|
|
|
|
|
in my project, i need Serial No like 1, 2, 3, in sequence in date wise
for Example today is 28/10/2009......so the serial no should be like 1.2.3
and when the date changes it must start again 1.2.3
any idea ?
thanks for help
|
|
|
|
|
You don't mention what your data store is. ASsuming a SQL DB, the resetting numbers mean you can't use an identity column, you probably just have to write code to work out the next value for the current date.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks for reply
i am using SQL DB
|
|
|
|
|
Sir i am trying like this....
getting the todays date and then number of records and then adding +1 to the number of records......
if date is changed (means next day) then again start from 1 and then +1 ....
is this right ?
thanks for help
|
|
|
|
|
It's your business rule, but I think you described it correctly, yes.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks sir i got.........
thank you very much.......
|
|
|
|
|
In the following code, the size or the array is fixed to 16384 and I made changes to it to get errors. Can someone clearify why it is fixed?
byte[16384]???
private void Start()
{
Stop();
try
{
WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
m_Player = new WaveLib.WaveOutPlayer(-1, fmt, 16384, 3,
new WaveLib.BufferFillEventHandler(Filler));
m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, 16384, 3,
new WaveLib.BufferDoneEventHandler(DataArrived));
}
catch
{
Stop();
throw;
}
}
private void Voice_In()
{
byte[] br;
r.Bind(new IPEndPoint(IPAddress.Any, int.Parse(this.textBox2.Text)));
while (true)
{
br = new byte[16384];
r.Receive(br);
m_Fifo.Write(br, 0, br.Length);
}
}
|
|
|
|
|
What is WaveLib ? It seems odd that you'd need to use a certain value all the time, perhaps it just must be a power of two ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
As Christian Graus says, without knowing what WaveLib is, we really can't help.
This is just a hunch, but the magic number 16384 is repeated in you code,
have you tried something like this
const int Size = 16384;
private void Start()
{
Stop();
try
{
WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
m_Player = new WaveLib.WaveOutPlayer(-1, fmt, Size , 3,
new WaveLib.BufferFillEventHandler(Filler));
m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, Size , 3,
new WaveLib.BufferDoneEventHandler(DataArrived));
}
catch
{
Stop();
throw;
}
}
private void Voice_In()
{
byte[] br;
r.Bind(new IPEndPoint(IPAddress.Any, int.Parse(this.textBox2.Text)));
while (true)
{
br = new byte[Size];
r.Receive(br);
m_Fifo.Write(br, 0, br.Length);
}
}
Assuming this works you can then try changing the value of size to suit.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
hi
i build C# program on Windows-Mobile that connect to WebService through cradle
and work with ActiveSync.
the customer want me to change the program that the connection will be through IP cradle.
is it require me any code change ?
how to do it ?
thank's in advance
|
|
|
|
|
I have created some custom control (winform c# .net) that has a "switch" inside it.
Inside it, i've made a propety that "wraps" the switch & allow to toggle it.
Component works fine at run-time, but it sorta nags me it doesn't re-paint the control at runtime when i set the property via property editor.
If i rebuild project, it updates allright, but I wondered if there is any way to make it update as soon as i update the property while still in design-time.
Would appreciate any help on matter.
regards.
|
|
|
|