|
I don't see the probblem.
If the user is running his program on his computer then you can do whatever you want, no?
If you have a web page then simply store the file name in a session or something like that.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have a MainForm (MDIParent), a ChildA form and a Child1OfChildA Form. I have a Panel controll on ChildA Form, How can i place Child1OfChildA on this panel controll on ChildA from?
Thanks
|
|
|
|
|
I have a c# program which retrieves registry settings & writes them out to a .reg file for storage on a network so some application settings can easily be restored after an operating system upgrade, etc. Everything was going just fine until I came across a value of type dword.
If I manually export it from the registry, this is how the name and value look.
"Number of Macros"=dword:00000012
The .GetValue method brings the value in as type System.Int32 with a value of 18 (there are 18 macros defined in that app). Is anyone familiar with this dword type and what I would convert Int32 to to get this value of 00000012?
Thanks in advance for any help!
Lara
|
|
|
|
|
The dword type is a 32-bit signed integer on 32-bit systems. The output you are getting from the registry is 0x00000012 which is 18 in hex. The registry stores dword values in hex. You could always do a decimal to hex conversion to convert 18 to its hex value.
Andy
Deus caritas est
|
|
|
|
|
Got it. Excellent. Thanks!
|
|
|
|
|
I get this error when I try to use implement the IEnumerable interface:
Error 1 'generics.GenStack<t>' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'generics.GenStack<t>.GetEnumerator()' is either
static, not public, or has the wrong return type.
Here is the code segment:
// Custom Stack - designed to accept class instances only
public class GenStack<t>: IEnumerable<t>
where T : class
{
private T[] stackCollection;
private int count = 0;
// Constructor
public GenStack(int size)
{
stackCollection = new T[size];
}
public IEnumerator<t> GetEnumerator()
{
string totList = "";
for (int i = 0; i < count; i++)
{
yield return stackCollection[i];
totList+= stackCollection[i]+" ";
}
object ob = totList ;
yield return (T)ob;
}
.
.
}
I am implementing the GetEnumerator(), though. Am I missing something?
Thanks in advance
|
|
|
|
|
A little curious by your code snippet. Try:
<code>
public class GenStack<T> : IEnumerable<T> where T:class
{
public GenStack(...) { ... }
public IEnumerator<T> GetEnumerator() { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { }
}
</code>
-- modified at 16:53 Tuesday 14th February, 2006
|
|
|
|
|
Can someone tell me how exact it is to customize the size of the buttons in the MessageBox control? I am planning to make my MessageBox by inheriting the one in the .net library.
I know there is something to do with the onPaint event handler, but i am not very sure
thx for all your help
|
|
|
|
|
As far as I know you cannot inherit the one in the .NET library since this is simply a wrapper around the Win32 MessageBox functions.
What I have done is to use a CBT hook to hook the MessageBox right before it is displayed, and in the CBT_ACTIVATED I can change/add/delete controls on the MessageBox. You can get the control ids using Spy++ on any MessageBox. There is a lot of interop involved with this but it works fine. You need to learn about CBT hooks and P/Invoke with .NET to make this work.
I hope this helps.
Andy
Deus caritas est
|
|
|
|
|
Why not just create a dialog form that is your own custom MessageBox? You then could use any controls in it you want.
Paul
|
|
|
|
|
Hi:
does dotnet/c# offer any smart and automated ways to preserve user preferences in GUIs such as controls users like to have checked or unchecked?
Thanks, smurfy
|
|
|
|
|
smurfy,
Not sure if .net has the ability, but saving control states in a database may be the way to go, depending on how many controls you are working with.
I hope this helps some,
Paul
|
|
|
|
|
VS2005 does. It saves initial values for just about any aspect of a component (control) in a app.config file, and stores user-specific and machine-specific settings in the application data directory in the appropriate profile directory. You can read, write and save settings anywhere in your application.
Mark
|
|
|
|
|
Cool, learned something new today
Paul
|
|
|
|
|
** You can read, write and save settings anywhere in your application.
Ok, in VB.net there's My.Settings, but how about c#, how do I do this in C#?
|
|
|
|
|
With BorderStyle set to Fixed Single, in the Paint method I tried to draw my own border color but the Paint would never get called for ListBox/CheckedListBox. Is there any difference from ListBox/CheckedListBox and other controls. I know that we need to override OnDrawItem , OnMeasureItem to customize the items in the ListBox but how do I change the border color of the ListBox itself?
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (this.BorderStyle == BorderStyle.FixedSingle)
System.Windows.Forms.ControlPaint.DrawBorder(e.Graphics, ClientRectangle, _borderColor, ButtonBorderStyle.Solid);
}
Thanks in advance,
VPMahank
|
|
|
|
|
You may have to handle WM_NCPAINT to do this since the border is not part of the client area.
Deus caritas est
|
|
|
|
|
i want a component that convert numeric of digit to alphbet digit
########################
|
|
|
|
|
amin saffari wrote: i want a component that convert numeric of digit to alphbet digit
You forgot the magic word, and could you explain a little more in detail what you are trying to accomplish?
|
|
|
|
|
|
Hi, Has anyone experienced this problem?
by VS2005 C#, i had made class library project contains custom control called "DynamicPanel" inherited from System.Windows.Forms.Panel, this "DynamicPanel" contains some child controls ..
now in my WindowsApplicationProject --> Form1 i'm Draging "DynamicPanel" from the toolbox and all properties was found in PropertyGrid .. but i want to be able to access the properties of any of the child controls in "DynamicPanel" by selecting them ( by clicking on them ) in design time. how can i do that?
I would appreciate your help ...
-- modified at 6:19 Sunday 19th February, 2006
|
|
|
|
|
Hi all,
I am using WMI to create a process in the remote system.But the problem is i cant able to see the UI in the remote system,but i can able to see the process in the task manager..Is there any way to get the User Interface??..PLease help
|
|
|
|
|
You can't do this. For security reasons, WMI can't create an interactive process remotely.
More on this can be found here[^], in the Win32_Process docs.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thank you for the reply sir...Do i have any other way to create an interactive process other than WMI?
|
|
|
|
|
Not an interactive one. The security restriction isn't with WMI, it's with Windows...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|