|
James T. Johnson wrote:
I believe the ^ operator is what you want to use there.
Yes,thats it.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I want to do some operation when the application run,but after my form become visible,If I put my operation in construtor or Load ,it does the operation before the form become visible.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
maybe something like
class Form1 : System.Windows.Forms.Form
{
bool shown = false;
...
private void Form1_Activated(object sender, System.EventArgs e)
{
if (!shown)
{
shown = true;
MessageBox.Show("I'm here.");
}
}
}
does the job for you.
the "Activated" event with a bool to show it only once (after construction)
not really nice, because everytime the form is activated this comparison takes place, but hey: in times of gigahertz and garbage-collectors - who cares about one function call and one comparison
:wq
|
|
|
|
|
Thank you,I'll check it as soos as I go home.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Actually there is an even better way if you are really concerned about performance.
class Form1 : System.Windows.Forms.Form
{
public Form1()
{
InitializeComponent();
this.Activated += new EventHandler(Activated_PerformOnce);
}
private void Activated_PerformOnce(object sender, System.EventArgs e)
{
this.Activated -= new EventHandler(Activated_PerformOnce);
}
} Amazing what comes to you while you sleep :-P
James
Simplicity Rules!
|
|
|
|
|
1.I hava Datagrid control in window forms, which bind data from datatable. I don't want to show "id" field, but I think I need it for click event on a certain row in datagrid. How can I hide this field but still can get value from it?
2. How can I specify the column width for each column?
Thanks.
Beginner
|
|
|
|
|
For #1 give this a shot
int columnIndex = 1;
GridColumnStylesCollection myGridColumns;
myGridColumns = dataGrid1.TableStyles[0].GridColumnStyles;
myGridColumns.RemoveAt( columnIndex ); For #2 there try this block.
GridColumnStylesCollection myGridColumns;
myGridColumns = dataGrid.TableStyles[0].GridColumnStyles;
foreach(DataGridColumnStyle style in myGridColumns)
{
style.Width = GetColumnWidth(style.HeaderName);
} HTH,
James
Simplicity Rules!
|
|
|
|
|
I want to set the image properties of items in a listview/treeview to various memstream/filestreams I have (that are images).
Any idea how I can do this?
Cheers,
Simon
"I get paid for my brain and my thinking in several obscure worlds", Olli, The Lounge
|
|
|
|
|
You'll have to create a new instance of the Image class from the contents of the stream.
treeNode.Image = Image.FromStream(myStream);
HTH,
James
Simplicity Rules!
|
|
|
|
|
What is the .NET equivalent for CButton::GetState?
Any help is hugely appreciated.
Thank you,
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Nish,
You can use the .Checked attribute
if(checkBox1.Checked)
{
MessageBox.Show("Checkbox1 is checked");
}
if (radioButton1.Checked)
{
MessageBox.Show("radioButton1 is checked");
}
HTH
Nick Parker
This is a non-Calculus course as long as you know things like line integrals and surface integrals...
|
|
|
|
|
The GetState function he's looking at tells you if the button is currently in the 'clicked' state, when the mouse button is held down on top of it.
The way to do this is to capture the mousedown/up events on the button and set a flag there.
James
Simplicity Rules!
|
|
|
|
|
I was going off the definition that Microsoft shows for CButton::GetState at:
CButton::GetState
Microsoft says:
Specifies the check state (radio buttons and check boxes only). A 0 indicates the button is unchecked. A 1 indicates the button is checked. A radio button is checked when it contains a bullet (•). A check box is checked when it contains an X. A 2 indicates the check state is indeterminate (three-state check boxes only). The state of a three-state check box is indeterminate when it contains a halftone pattern.
I could have been wrong, just the way I understood it
Nick Parker
This is a non-Calculus course as long as you know things like line integrals and surface integrals...
|
|
|
|
|
Yeah, thats when you pass in 0x003, Nish was looking for 0x004, the 'highlight state'; but he didn't mention that in the post I asked him that over sonork last night :-P
James
Simplicity Rules!
|
|
|
|
|
I knew I hadn't been that far off, thanks.
Nick Parker
This is a non-Calculus course as long as you know things like line integrals and surface integrals...
|
|
|
|
|
I just bought visual studio.net academic, I also plan to buy a new computer.
My question is can I install vs on the computer i currently use, and be able
to install it on my next computer. If not i will wait for my next computer
to do so?
thanx
|
|
|
|
|
As far as I know VS.NET does not have activation of any kind. So as long as you remember to remove it from your old computer you can install it on your old computer while you wait to get a new one.
James
Simplicity Rules!
|
|
|
|
|
Even if it is the VS.net academic?
|
|
|
|
|
Hmmm, it does look like the academic edition has activation. In the Addendum to the EULA for MS Products, section 1.1 of the EULA is delated and replaced with 2 more paragraphs, paragraph b is titled "Mandatory Activation." Rather than a day limit it appears it uses number of times you've launched VS.NET as your counter.
James
Simplicity Rules!
|
|
|
|
|
If it does have activation, you should be able to go 30 days without activating; so you can use it unactivated while you wait for your new computer to activate it.
James
Simplicity Rules!
|
|
|
|
|
I have the academic version installed at home, it will allow you to run VS.NET 4 times before it requires you to activate it.
Nick Parker
|
|
|
|
|
did you install it on another computer or bye another licence ?
|
|
|
|
|
In my EULA for VS.NET academic, it says I can install the software on up to three computers. You shouldn't have any problems unless you chnge your hardware more than two times. Then you'll have to call good ol' MS to get it straightened out.
James
|
|
|
|
|
I wanna read/write registry,Can anybody tell me the name of class I should use.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Easy: RegistryKey.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|