|
|
Simple way to do this (only on OS>=WinXp) is to use ICDBurn.
(application can copy files to Burn folder and open winxp burning wizard)
i'm only pointer to myself
|
|
|
|
|
With VS 2002 we could send a GET request to a web service and it would work. After upgrading to VS 2003 it doesn't work and doesn't seem to be available. Anyone know what happened?
ed
Regulation is the substitution of error for chance.
|
|
|
|
|
Hi, working with DataGrid on a Windows Form right now. Three questions:
Q1: It seems that Windows Forms DataGrid doesn't support paging as they do on WebForms.
Q2: How can I disable editing on cell(s)/rows belonging to a particular column?
Q3: Any good tutorial on how to embed controls in Windows Form DataGrid? Controls like buttons and other stuff...etc. With WebForms' DataGrid, it's done by <ItemTemplate>. How can we do the same here on Windows Form? With "Checkbox", just feed in a column of type "bool", simple. But with other types? Buttons, links...
Thanks a bunch.
norm
|
|
|
|
|
Q2: How can I disable editing on cell(s)/rows belonging to a particular column?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridcolumnstyleclassreadonlytopic.asp
Q3: Any good tutorial on how to embed controls in Windows Form DataGrid? Controls like buttons and other stuff...etc. With WebForms' DataGrid, it's done by . How can we do the same here on Windows Form? With "Checkbox", just feed in a column of type "bool", simple. But with other types? Buttons, links...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridclasstopic.asp
|
|
|
|
|
Thanks for the tip. I got it working now (enabling/disabling in-place editing). It's very convenient - I still remember way back when I was working with MFC. I need to actually draw an editbox and override a whole bunch of events to get this simple functionality. Glad .NET finally arrives.
But I don't think the second reference on DataGrid provides much information on embedding controls within DataGrid.
norm
|
|
|
|
|
great, as you could fine answer to one of your questions.
i am not a c# expert, actually have just started reading c#, but just trying to find answer of the queries asked here, helps me also in improving my knowledge of c#.
as far as embedding controls within DataGrid, i couldn't find anyway to do it. if you find the answer, please post it here, i would love to know.
|
|
|
|
|
You can show controls in DataGrid, for e.g. showing a button control in a column by adding those controls to the grid.
// Create a control
Button myButton = new Button();
myButton.Visible = false;
// Add the button to the data grid
myDataGrid.Controls.Add(myButton);
// Now handle the Paint event of the grid
OnDataGridPaint(..)
{
if (myDataGrid.CurrentCell.ColumnNumber = <columnnumber>)
{
myButton.width = myDataGrid.GetCurrentCellBounds().Width;
}
}
// CurrentCellChange event
OnDataGridCurrentCellChangeEvent(..)
{
if (myDataGrid.CurrentCell.ColumnNumber = <columnnumber>)
{
myButton.Location = myDataGrid.GetCurrentCellBounds().Location;
myButton.Visible = true;
}
else
{
myButton.Visible = false;
}
}
// Handle Layout and Scroll events of DataGrids
OnDataGridLayout(..)
{
OnDataGridCurrentCellChangeEvent();
}
OnDataGridScrolled(..)
{
OnDataGridCurrentCellChangeEvent();
}
This is just psuedo code. You may have to do some more tweaking for this to work. But this is generally how it is done (or how I have done it!)
Hope this helps.
Suhas
|
|
|
|
|
Thanks Suhas, I think I understand what you're getting at.
norm
|
|
|
|
|
I added assemblies to the GAC. When I want to add a reference, I don't see my assemblies in the .NET tab. I can see them from the Microsoft .NET Framework 1.1 Configuration control panel
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
VS.NET doesn't use the GAC for pulling the list of assemblies you can reference. In fact none of the MS compilers allow you to reference an assembly in the GAC, instead the reference is made to files located in a regular directory. For the core assemblies of the CLR that location is %WINDIR%\Microsoft.NET\Framework\%version%\
VS.NET gets its list from some registry keys under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders (replace 7.1 with 7.0 if running VS.NET 2002)
There is also a similar key under Software\Microsoft\.NETFramework, but I can't remember if VS.NET looks under this key or not.
James
"then when you go to bed...wait, you dont do that do you....ok....when you plug into the 'hive mind' to charge yourself, ill hack into your head"
Nnamdi Onyeyiri over MSN
|
|
|
|
|
I have an application (BizTalk Server 2004, running as Administrator) that accesses custom components, which are referenced in my project (a class library project).
What happens is that my custom class is correctly loaded by the application, which custom class access another assembly. This last assembly loads another assembly using the following code:
Assembly assembly = Assembly.Load(assemblyName);
IComponent result = (IComponent) assembly.CreateInstance(className);
The first line of code works , but the second one throws the exception. Here is the stack trace:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
at System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName)
Tx
Michel
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
System.UnauthorizedAccessException is almost thrown, when you try to change a file which is allready in use.
for example:
1. Assembly.Load( test.dll)
2. ... // do something
3. File.Delete(test.dll),while application is still running
--> Exception --> so you need to unload the assembly.
for this you have to use an AppDomain.Unload(...)
but I have the same problem too. so I can't really help you at the moment. use everything like AppDomain.Create, .Load,... maybe you find a solution. I would also need it.
thx
Christian
|
|
|
|
|
I finally found why. The assembly was a ServicedComponent (COM+). I was trying to load an assembly that had the same print as in COM+. This is now fixed.
Still have a problem to fix (SerializationException) but I'm on my way for this one.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hi, I need to implement my own MouseHover event for a library I'm working on.
What is the exact logic of the MouseHover event? I can't find this on MSDN...
It seems like the MouseHover is fired only after the first N milliseconds that the mouse is idle in a control, and perhaps only if the control has focus. I expect I'd set a Timer when the MouseMove event is fired, and then invalidate the Timer if the MouseMove event was fired before N milliseconds had elapsed.
|
|
|
|
|
Arun Bhalla wrote:
I need to implement my own MouseHover event
Why? It's built into WinForms.
If you really need to roll your own, try TrackMouseEvent[^].
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I'm writing a library of lightweight control-like objects which paint themselves on controls, such as Panel. I need to mimic MouseHover for these control-like objects. If I use Panel's MouseHover event, I only get the hover event once, while the cursor is in Panel's bounds, even if it hovers over my different control-like objects, all within Panel.
TrackMouseEvent seems like it may be the way to go, or at least I'll know where to dig for the default value. (Yet another setting missing from SystemInformation.) Thanks!
|
|
|
|
|
Arun Bhalla wrote:
I'm writing a library of lightweight control-like objects which paint themselves on controls, such as Panel.
Hehe, my team is creating a library of lightweight controls, called Fluid UI Toolkit[^]
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Cool! I look forward to seeing that near completion... as we all know, the Microsoft-provided WinForms library is not so hot.
I guess my library is quite different from yours... mine is more like Visio shape objects rather than things like toolbars.
|
|
|
|
|
Arun Bhalla wrote:
I guess my library is quite different from yours... mine is more like Visio shape objects rather than things like toolbars.
I figured that. Actually, I plan to use mine for document drawing objects, as it will probably lend itself well to that.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
The main reason (or rather, the straw that broke the camel's back) I wrote the library is that Control.Location, etc. didn't inherently support the location on a ScrollableControl relative to AutoScrollPos. Very annoying. There were other issues, though.
|
|
|
|
|
.NET AutoScroll== .
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Yeah, and I'm lazy. AutoScroll seems to mostly work, but in a tricky and incomplete way. Oh well!
|
|
|
|
|
I have a multiline textbox and wanted to know if there was any way to limit the characters that are entered to HEX characters ... I wanted to find an easier way than using the || against all the possible characters that I want to accept ...
Thanks
|
|
|
|
|
Add a handler for the KeyPress event of your text box
<br />
private void myHexTextbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
string Allowed = @"0123456789ABCDEFabcdef";
if (Allowed.IndexOf(e.KeyChar)==-1)<br />
{<br />
e.Handled = true;
}<br />
}<br />
|
|
|
|