|
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
|
|
|
|
|
I am writting a program that connects to an access database, queries employee names, stores these names in an ArrayList, and are added to the comboBox item list. Currently, I have the program querying the database after I change the selectedIndex of the comboBox but the problem is this, dupelicate names are being added to the comboBox which are out of the Array Index (I am using ArrayList.Clear()). The next thing I have tried is having the comboBox items cleared after the Selected Index is changed but this poses a problem, the current selected index is cleared and there is no telling what employee you are looking at. Are there any other solutions to this problem or do I just have to settle with the selected index being cleared?
Thanks in advance,
Patrick
|
|
|
|
|
Your question is an absolute mess. Just try reading it as somebody who does not have any background. First of all, if your program "queries the database on selected index changed", then question that comes to any sane mind is what was in the listbox before the database was queried (what was in it that resulted in selected index changed, and how it had come in the first place?). Next question is after selected index (of whatever), you query the databse - and then what? What happens to your existing combobox data? It all goes away? What kind of combobox is that - you click it and it gets refreshed? (My god!)
No doubt your question was not answered by anybody in so many hours. You are lucky that I logged in after a hard day's work looking for unanswered posts. I mean if you are still waiting for an answer! If you are not, grab a beer buddy...
Koushik Biswas
|
|
|
|
|
After I re-read my post I couldn't agree with you more on how messy it is, so I will try to clear this mess up.
Here's what the program does:
1)opens an access database and gathers employee information such as name, social security number, and a ref number that will be used to link the employee to corresponding images.
2)an arraylist is made and contains of the social security numbers.
3)the names and SSNs are added to the combobox.
4)when a name is selected a listbox fills with the employees documents.
a. when a document name is clicked on it is displayed in a picturebox.
5)when the name is changed in the combobox the whole connectToAccess procedure is run again, queries database, fills datasets/datatables, fills combobox, populates arraylist with SSNs.
you should get the idea now.
The problem is this:
Every time the employee is changed items are added to the combobox that are not indexed in the arraylist, thus adding items that have no index causing the program to crash. A few people I have talked with have said that I should just clear the combobox, which solves the problem above but creates another problem, clear the combobox and you clear the selected employee name, leaving the user of the program no reference to what employee they are looking at. It was also suggested that I create a var and store the selected employee's name in it, while this would work I would rather modify the ConnectToAccess procedure so that I can just read from the datatables I created and never actually query the access database again during the runtime of the program. I can send the code if it is needed.
Patrick
|
|
|
|