|
Thanks a lot, the ToolStripControlHost did it. However I only get it to work when I manually edit the Control.Designer.cs and its not showing in the IDE, anything I have to add here ?
This is what I have :
<br />
public class ToolStripNumericUpDown : ToolStripControlHost {<br />
public ToolStripNumericUpDown() : base(new NumericUpDown()) {<br />
}<br />
<br />
public NumericUpDown NumericUpDownControl {<br />
get {<br />
return Control as NumericUpDown;<br />
}<br />
}<br />
<br />
<br />
<br />
public decimal Value {<br />
get {<br />
return NumericUpDownControl.Value;<br />
}<br />
set {<br />
value = NumericUpDownControl.Value;<br />
}<br />
}<br />
<br />
protected override void OnSubscribeControlEvents(Control c) {<br />
base.OnSubscribeControlEvents(c);<br />
<br />
NumericUpDown mumControl = (NumericUpDown)c;<br />
<br />
mumControl.ValueChanged += new EventHandler ( OnValueChanged );<br />
}<br />
<br />
protected override void OnUnsubscribeControlEvents(Control c) {<br />
base.OnUnsubscribeControlEvents(c);<br />
<br />
NumericUpDown mumControl = (NumericUpDown) c;<br />
<br />
mumControl.ValueChanged -= new EventHandler ( OnValueChanged );<br />
}<br />
<br />
public event EventHandler ValueChanged;<br />
<br />
private void OnValueChanged(object sender, EventArgs e) {<br />
if (ValueChanged != null) {<br />
ValueChanged(this, e);<br />
}<br />
}<br />
}<br />
thx agian
|
|
|
|
|
Add:
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)]
to show it in IDE
|
|
|
|
|
Is there any way i can run a code snippet inside a different appdomain? (So i can load the same assembly twice for some reason)
public class MyFooBarAssembly
{
public myFooBarAssembly(string loadFrom)
{
assembly = AssemblyName.GetAssemblyName(loadFrom);
}
AssemblyName assembly;
public AssemblyName[] GetReferencedAssemblies()
{
return Assembly.ReflectionOnlyLoadFrom(assembly.CodeBase).GetReferencedAssemblies();
}
}
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
First create the new domain:
AppDomain myNewAppDomain = AppDomain.CreateDomain("MyNewAppDomain");
Then create the class you want to run code on in the new app domain.
Object myObjectInADifferentDomain = myNewAppDomain.CreateInstanceAndUnwrap(myAssemblyName, myTypeName);
Then just call the methods on it as you would normally with reflection.
Simon
|
|
|
|
|
Oh, sorry, I didn't read your question properly. You can use
newAppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate);
and just pass in a CrossAppDomainDelegate for the method you want to run. That will allow you to execute your method in a different domain. (You might have to change your method slightly to match the CrossAppDomainDelegate)
Simon
|
|
|
|
|
Thanks! exactly what i needed
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
My pleasure
(If only everyone was polite like you)
Simon
|
|
|
|
|
Hi everybody!
I'm using DevExpress components.
You can call Print() method of Grid Control to print the current Grid with all user customizations, but, we need to add our company header to all of our reports. So, we have to add the header to grids reports, too.
I found a solution in net: Using PrintingSystem and linking grid to it. Then handling CreateReportHeaderArea event of the link and making header in this handler, but, i cannot draw our header by DrawString() or DrawImage() and etc. methods. I have created a Report Header before and i wanted to add it as a sub report to grid report.
Unfortunately, i just found an AddSubReport method in link object, but, i don't know how i can access to this adding sub report.
I would be so grateful if you help me.
Regards,
Chapooki
|
|
|
|
|
|
thanks,
I had seen that sample before, but i cannot make my header by draw string and .... i have a header which user can change it and i want to add it as a sub report to all other reports. Any way, i changed my design to make my report manually and not use DevExpress Grid Control print.
Thanks again,
Chapooki
|
|
|
|
|
Hi,
I'm new to Visual Studio 2005 Windows application.
I need to add two button controls in a single Gridview cell using C# Windows Application.
Can Anyone Tell me the solution for the above Scenario?
Thanks in advance
regards
sri
|
|
|
|
|
Check this[^]
My idea of ideal life : Eat, Sleep, Repeat
|
|
|
|
|
Is there any way to acheive other than User control?
|
|
|
|
|
1. Create a button column
2. Add padding using datagridviewcellstyle property.
3. Handle cellpainting event to create another button in the cell.
My idea of ideal life : Eat, Sleep, Repeat
|
|
|
|
|
I have created an application using C# 2003
It runs well sometimes, and sometimes it gives the following error
"unable to find a version of the runtime to run this application"
Everytime this message appear, I have to rebuild my application
How to resolve this
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
|
Hello,
i have a little problem with some Controls, which i have in Forms, UserControls and so on...
in VB.NET it is possible to access them easily with a code like this:
Dim myControl As MyNewUserControl
myControl.Label1.Text = "here's a text"
... now something like that isn't possible in C#, i cannot access for this example a Label, because all labels and other controls aren't there, i get an error, that these Controls doesnt exists. My Code:
MyNewUserControl myControl = new MyNewUserControl();
myControl.Label1.Text = "here's a text"; //Here it doesn't works
What to do now? Thanks for your help.
|
|
|
|
|
|
stancrm wrote: Try to make a property for that
or set Label1 to public.
Ugh!
Don't make labels properties. Make the things you want to change about a label properties. If you make the label a property you can completely lose control over what happens to the label.
Making the label public is worse! Have you never heard of "encapsulation" (aka "information hiding"). It is one of the basic tenets of Object Oriented programming - and you are willfully breaking it without good reason.
|
|
|
|
|
Oh XD
now i've seen that they all are private XD the label was only an example, because if i wanted to change a background or something else and so on it wasn't possible. I could only acces my own methods and variables (of course they was public)
thanks, because VB.net setted those properties automatically to public.
|
|
|
|
|
hi all,
How can i add the shortcut key in my window application. I have a datagridview, after i click on certain row,after that if press "Ctrl + A" then some event will fire.
Any tips are welcome,
Thanks in advance.
regards
cocoocwls
|
|
|
|
|
The DataGridView has a KeyDown event. Use this. In it, check if the keys being pressed are Ctrl and A. If they are then you can perform whatever action it is that you want to do.
Simon
|
|
|
|
|
Hi Simon,
yes, thanks for your suggestion
|
|
|
|
|
hi friends...
how to know SQL server Express is installed in XP and Vista.Anyway to check that ?..registry keys or somethin like that.I hav to create a setup ..before that I need to check whether SQL Server Express 2005 is installed or not.It wil be very helpful for me if you explains with sufficient codes.
With warm regards
denver
|
|
|
|
|