|
I'd like to write an application in C# that reads and displays the contents of the Windows Address Book wab file. Can this file be read, maybe through Jet?
|
|
|
|
|
|
public delegate void EventHandler(int Index);
public event EventHandler PressIcon;
public virtual void OnPressIcon(int index)
{
if (PressIcon != null)
PressIcon(index);
}
..
OnPressIcon(this.SelectedIndex);
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
public delegate void EventHandler(int Index);
public EventHandler PressIcon;
This does however work. Although it looks not right, can some please explain what the difference is between the above and this below?
public delegate void EventHandler(int Index);
public event EventHandler PressIcon;
protected virtual void OnPressIcon(int index)
{
if (PressIcon != null) PressIcon(index);
}
I know options 2 is the "correct" way, but how does this differ?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
i think
1. The second give the user the ability to override what happens in that event in derived classes
2. if an event handler is not attached to PressIcon, then it will be called, but there will be no body, that is why the first gives an exception when the code is called, with no event handler attached.
get what i mean>?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
if an event handler is not attached to PressIcon, then it will be called, but there will be no body, that is why the first gives an exception when the code is called, with no event handler attached.
get what i mean>?
You didnt note the changes ?? In example 1 i declare only a delegate, not an event delegate, thus the OnPressIcon function is not neccesary and u call the delegate directly.
In the implementation , u would just call "it" like u would for an event except u call the delegate directly. This works! But what are the differences between the two?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hi all,
I try to have a MDI application.
What I am trying to do is to make main window to have a treeview control in it. I want to place on left side of the main window. So, when a child window is opened and maximized it will occupy the rest of space on the main window.
How can you accomplish this?
ATM, i already tried, but when i maximized child window, it occupy the whole main window space.
Thanks for the help
Eka
|
|
|
|
|
Set the TreeView 's Dock property to DockStyle.Left , that should be all you need to do.
Assuming you set the child form's MdiParent property to the instance of the main form.
James
|
|
|
|
|
Hi all,
I try to open and read from a text file but it always gives me error.
Code as followed: (the "UserList.lst" is the same dir with the exe which is
C:\Read\bin\Debug)
FileStream fs = new FileStream("UserList.lst", FileMode.Open);
StreamReader sr = new StreamReader(fs);
I get error on the first line which it says:
"Un unhandled exception of type 'System.IO.FileNotFoundException'
Additional information: Could not find file "C:\Read\bin\Debug\UserList.lst"
Can someone help me with this?
(The file UserList.lst is in that dir)
Thank you
NT
|
|
|
|
|
|
Thanks Leppie actually my code or your code as shown work.
In windows XP, Explorer doesn't work the correct file extension.
Have a nice day Leppie.
|
|
|
|
|
Works fine here; perhaps the filename was mistyped?
James
|
|
|
|
|
I have made a windows form in C# and I want it to permanently be displayed on the computer desktop.All other applications should have open under it.What I mean is that any application which opens should have the desktop area below my form available to it.
My form is a small strip.
|
|
|
|
|
|
With top most property the form will become the top- level window.I want this top level window to be dockable to the desktop.Something like the APPBAR.
|
|
|
|
|
|
Hi,
I wrote a multi-threaded application that sends/recieves documents on a scheduled/event driven basis. It works fine as a console application the files are being sent and the CPU usage is around 30%. My problem is when I have the exact same code in a Windows Service application. When the service is using one thread to send documents it also works fine, but if there is more than one thread running at one time the CPU usage shoots up to 100%. Could someone please help me?
Thanks
P.S. The applcation is also using the System.Timer and File System Watcher.
Thanks Again,
Aisha
|
|
|
|
|
I am writing a client/server application with the server running on Linux written in C++ and the client application running on Windows XP written in C#. I am sending JPEG images over the network from cient to server and am getting some very odd behavior. It appears that after each JPEG I transmit I get about 1 - 3 packets containing 1 byte of useless information. Is this something with BinaryWriter that is it sending additional informaiton about what it sent?
Thanks,
Steven
|
|
|
|
|
I need to have a multiline textbox with a passwordchar. I know that the passwordchar property will not work in multiline mode. So, I figure on capturing the keypress event to create the same effect but there is one problem: -
I can't figure out how to substitute the '*' character for the key pressed. Everything is read only.
Thanks,
Bill Ferreia
|
|
|
|
|
every time you enter into the textbox, the TextChanged Event is called, maybe u could do something there?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Say you have two projects written in different .NET languages (C#.NET, MC++.NET) How do you reference the classes of the MC++.NET in the C#.NET project?
I don't have any problems importing the projects into the solution, but I can't figure how to reference the classes.
Thanks,
Bill Ferreira
|
|
|
|
|
is the MC++ code in a DLL? im not sure if you can then just reference it as u would a c# dll - ull have to try.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
How do I center a message box to my application form. I have tried passing the application form as the parent of the message box but it still appers centered to the desktop.
MessageBox.Show(myForm, ...);
Joel
|
|
|
|
|
I need to know if there is a vertical scrollbar in a listbox. there is a bool HorizontalScrollBar property, but not a bool VerticalScrollBar
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
You have ItemHeight (in pixels) and Height of the control... so you can try something like:
<br />
bool bVertScrollBar = lb.ItemHeight * lb.Items.Count > lb.Height;<br />
Just take into account that you can change the units of your form (with AutoScaleBaseSize).
-- LuisR
p.s. And take into account that the horizontal scroll bar could be displayed also, thus reducing the height of the display area.
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|