|
you can, have lots of fun reading the mp3 spec and experimenting to find the least lossful ways to do encoding. Most projects use a 3rd party encoder because doing this in a way that sounds good is not an easy task.
--
CleaKO The sad part about this instance is that none of the users ever said anything [about the problem].
Pete O`Hanlon Doesn't that just tell you everything you need to know about users?
|
|
|
|
|
I want to build a webcontrol that has a reference to seperate controls on the page to manipulate them on pre-render. Does anyone know how to do this. Because I can not find any articles about it.
|
|
|
|
|
Hello frineds
in this code I wanted when I add 2 nums,the result be shown in another massagebox(plus in textbox in form)
I wanted to use predefined "Click" Please guide me.
namespace calculate
{
public delegate void Startdelegate();
public delegate void addnum();
public partial class tamrin : Form
{
// custom event
public event Startdelegate StartEvent;
private Form2 Form2;
public tamrin()
{
InitializeComponent();
this.Load += new System.EventHandler(this.Form1_Load);
StartEvent += new Startdelegate(OnStartEvent);
StartEvent();
}
button2.Click += new EventHandler(OnClickadd);
private void button1_Click(object sender, EventArgs e)
{
int result = int.Parse(num1.Text) / int.Parse(num2.Text);
MessageBox.Show(result.ToString());
}
private void button2_Click(object sender, EventArgs e)
{
int result = int.Parse(num1.Text) + int.Parse(num2.Text);
TextBox3.Text = result.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
int result = int.Parse(num1.Text) * int.Parse(num2.Text);
MessageBox.Show(result.ToString());
}
public void OnStartEvent()
{
Form2 = new Form2();
Form2.Show();
}
public void Form1_Load()
{
Form3 = new Form3();
Form3.Show();
}
public void Onclickadd()
{
int result = int.Parse(num1.Text) + int.Parse(num2.Text);
MessageBox.Show(result.ToString());
}
}
}
|
|
|
|
|
For a method to qualify as an eventhandler, it must have object sender and e eventargs as parameters.
f.e.:
form1.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
...
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
MessageBox.Show("test");
}
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Hello
I want to change this method
public void Onclickadd()
{
int result = int.Parse(num1.Text) + int.Parse(num2.Text);
MessageBox.Show(result.ToString());
}
So that it can be used by predefined "Click" event.
How?
|
|
|
|
|
hi all,
i need to display, image and other text coloms in ListBox/DataGridView
please anyone suggest me to how to go with this?
regards
prashanth
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
pashitech wrote: i need to display, image and other text coloms in ListBox/DataGridView
DataGrid[ ^] sample for datagrid having different types of data objects in the cells.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi everyone. I'm trying to use SPI_SETWORKAREA to reserve some space down the side of the screen for my application.
Everything works fine as far as other applications go (the space is reserved so that a maximised window doesn't cover the area, for example) but the desktop itself isn't affected. That is to say, icons on the traditional Windows desktop don't obey the new work area, meaning half of them end up underneath my window.
The code I'm using is as follows:
{
RECT R;
R.Left = 300;
R.Top = 0;
R.Right = Screen.PrimaryScreen.WorkingArea.Right;
R.Bottom = Screen.PrimaryScreen.WorkingArea.Bottom;
IntPtr p;
p = Marshal.AllocHGlobal(Marshal.SizeOf(R));
Marshal.StructureToPtr(R, p, false);
SystemParametersInfo(SPI_SETWORKAREA, 0, p, 0);
int ret = Marshal.GetLastWin32Error();
}
RECT OriginalScreen;
public struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
I know I can achieve all of this (including resizing the desktop icon area) by creating an AppBar, but would rather use the SETWORKAREA if possible. Has anyone got any suggestions? I'm running this on Vista if that makes any difference. Thanks in advance!
|
|
|
|
|
Is there a guide somewhere on the net about the layout of a form (windows or web)?
I'm searching more along the line of best practices or guidelines about placing the OK/Cancel buttons, tab order, placing the controls in a good manner, etc...
Searching google, Msdn and CP didn't deliver anything useful.
thanks !
V.
I found a living worth working for, but haven't found work worth living for.
|
|
|
|
|
V. wrote: Is there a guide somewhere on the net about the layout of a form (windows or web)?
Here[ ^] is one for web design tips.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
thanks
|
|
|
|
|
Welcome
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
<br />
int x = 1;<br />
int z = ++x + x;<br />
Console.WriteLine (x.ToString () + " " + z.ToString ());<br />
<br />
int x = 1;<br />
int z1 = x + ++x;<br />
Console.WriteLine (x.ToString () + " " + z1.ToString ());<br />
Why z is 4, but z1 is 3?
In accordance with
Operators (C# Programming Guide)
The operator ++ has a higher precedence than the operator +. In both cases, ++ must execute at first.
There's not this problem in C++!
Oleg
-- modified at 10:04 Wednesday 21st March, 2007
|
|
|
|
|
++x is a prefix increment operation and its result is the value of x after it has been incremented. Therefore, the first calculation is 2 + 2 whereas the second is 1 + 2 .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
It's all to do with prefix and postfix operators. If you break it down, you get the following:
++x is a prefix operator, so it performs the operation first - so it turns x from 1 into 2. Next, you add x again which is 2 by this stage.
In the case of z1, x is equal to 1 and then you add x back on, but increment it before you add it so the maths becomes 1 + 2.
Here's a one for you, what do you get with this:
int x2 = 1;
int z2 = x++ + x;
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
For ++x + x , because of the location of the pre-increment x is pre-incremented before it's value is substituted in the in the equation - so the expression effectively evaluates to z = 2 + 2 .
For x + ++x the value of x is substituted as the first operand in the equation before it is modified, then it is pre-incremented and substituted as the second operand in the expression. This makes the expression evaluate to z1 = 1 + 2 . At least that appears to be what's going on . . .
-- modified at 10:39 Wednesday 21st March, 2007
The compiler/run time environment/whatever has to substitute the value of x into both expressions twice. The first expression is evaluated as such:
z = ++x + x;
z = (x = x+1) + x;
z = 2 + x;
z = 2 + 2;
z = 4;
Whereas the second expression is evaluated like this:
z1 = x + ++x;
z1 = 1 + ++x;
z1 = 1 + (x = x+1);
z1 = 1 + 2;
z1 = 3;
In both expressions the pre-increment is performed before the addition, keeping the order of operation correct, but in the first expression the pre-increment happens before the value of x is substituted for the 2nd operand in the addition.
In C++ the compiler will examine the entire expression and evaluate any pre-increments before it does any value substitutions (apparently - this probably depends on what optimizations/type modifiers you specify), so it isn't that C++ doesn't have this problem, it's just that the code is being interpreted by different compilers and therefore will behave differently.
|
|
|
|
|
Varibrus wrote: Why z is 4, but z1 is 3?
+ is the arithmatic operator which works left to right
When int z = ++x + x; expression executes it increments the value of x and put it into stack(generally all the operations are done with the help of stack ). so stack will be 2 + value of x(i.e. 2) so result is 4.
When int z = x + ++x; expression executes stack will be 1 + incremented value of x(i.e. 2) so result is 3.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello!
I got a main form, which can set to be always-on-top (this is achieved using the TopMost property of the main form).
The problem now is that when opening a modal dialog box, the dialog appears behind the main window.
The brute-force solution would be to disable the always-on-top mode while displaying the dialog. A better solution would be to tell the dialog somehow that its parent is the main form and therefore to appear in front of it. I tried setting the Owner , Parent and ParentForm properties of the dialog, but nothing worked (Owner: doesn't do anything, Parent: not allowed for top-level controls, ParentForm: read-only property).
Any solution? How can the dialog displayed in front of the main window?
Thanks and best regards
Dominik
|
|
|
|
|
Did you try also enabling the TopMost property of the dialog.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
No, didn't try that
Works great, thank you!
|
|
|
|
|
Glad to hear my guess was right
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi !
I would like to implement the Progressive Disclosure Controls in windows forms using c# . The Progressive Disclosure Control is the same when you use the add/remove programs from control panel the particular row gets expand when its clicked .
Can anyone give a ref. or sample code for this kind of implementation.
Thankyou
/S.Kumar
|
|
|
|
|
I was watching to see if anyone would reply. So I'll make an attempt. I've done some reading on this, and it's a bit confusing. Progressive Disclosure is a UI pattern, and on MSDN[^] they talk about Prog. Disc. Controls like they're just arrows.
Start with the MSDN article, if you haven't already. Other than that, I myself am interested in whether there really are standard/custom controls like f.e. the one used in Add/Remove programs.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
ConstructorInfo ctor = LocatedType.GetConstructor(BindingFlags.NonPublic|BindingFlags.Instance, System.Type.DefaultBinder, new Type[] { }, new ParameterModifier[] { });
I've just been creating some code to let me unit test private methods on classes. I created the code and then thought that maybe i might want to test a private constructor in the future so i started playing with the get constructor method.
The thing that surprised me was that i need to use BindingFlags.Instance rather than BindingFlags.Static to get the constructor. Does this strike anyone else as strange?
Russell
|
|
|
|
|
No. When you think about it, the constructor is not a static method.
Deja View - the feeling that you've seen this post before.
|
|
|
|