|
Actually i want to access address book of outlook express that is default in windows , not the one which comes with office outlook.once you type wab in run dialoge. you will find this.
|
|
|
|
|
Hi,
The Global Address List (GAL) is an address book derived from Active Directory data maintained by the network administrator on the server.
If you want to access a user's Outlook contacts, use the Namespace.GetDefaultFolder method to return the contacts folder as a MAPIFolder or (in Outlook 2007) Folder object, then iterate that folder's Items or use the Items.Find or Items.Restrict method to filter for specific criteria.
The code below will get the names from the Address book:
string sname1 = objAddressList.Item(20).c.Item(1).Name;
|
|
|
|
|
Stop trying to pass off answers from other sites as your own.
Tell the OP that you have found a possible solution, where you found it, and most importantly give the link.
Random quotes from a site help nobody.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Just wanted to ask you to please put a break; in this loop? anywhere is the right place!
while(1 != 0)
{
ask 'how can i set the text of a textbox programmatically'
questions;
post 'Hi, this is MY answer (that i found on some site) of
YOUR question!' replies;
ask people for the code for this (the text of a textbox),
since you think the code you have (found in some other website)
works only for ASP.net.
}
And oh, I forgot... http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/fb771ae9-86e8-4568-b4d7-4216c69a223a[^]
05BEA407F8F0DFDB7A0F1E77F473EE0F
|
|
|
|
|
Hi,
I am working on a project where I have used a ListView to add and clear items. However, due to frequent adding and deleting, the ListView is being hard to maintain. So I thought of binding items to the ListView. Since it is not possible to bind an object to a ListView straight away, I was advised to use a GridView in a ListView and bind items to the GridView. I googled it to some extent, but I couldn't find an apt match. Can anyone post a link which might explain me what to do to use a bound GridView in a ListView? I'm using WinForms, not WPF...
Thanks in Advance,
ramz_g
|
|
|
|
|
A quick Google for "bindable ListView" came up with an article here on CP[^], along with a bunch of others all over the web.
|
|
|
|
|
Hi Dave,
Thanks a lot for your reply.. I have already analyzed the example project that you had posted a link to.. It doesn't suit my requirement because the example loops through a table and updates the ListView. That is exactly what I'm doing right now, just that I do not use a table but I iterate using a list of objects. But my case is that I add a huge number of items to the ListView at a moment, probably in the range of a few 1000's. That time, the performance of the ListView is not very pleasing. So, a pure DataBinding concept, as in the case of a DataGridView would be really helpful. I was told that a GridView in a ListView might serve this cause. Any opinions on this would be really helpful.
Thanks in Advance,
ramz_g
|
|
|
|
|
AFAIK it would be enormously difficult to put a gridview in a listview.
Why not simply use a DataGridView?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
Thanks for your reply. Using the DataGridView was always one the options that I had. Maybe its time that I zeroed-in on using the DataGridView...
Thanks,
ramz_g
|
|
|
|
|
I have the following code:
string name = "c:\\1.flv";
axShockwaveFlash1.Movie = name;
axShockwaveFlash1.Play();
And there is no playback. But when I try playing some swf file - everything is OK.
What am I misising?
Thanks.
modified on Thursday, May 14, 2009 12:32 AM
|
|
|
|
|
Are you absolutely sure it's a Flash Video file?? Does it play in a web browser??
|
|
|
|
|
100%. I've played it with FLV video player.
|
|
|
|
|
hello
is it possible to bakcup a database at a server and restore it at an otehr one?
if yes,thanks to give me some ideas
|
|
|
|
|
Yes - assuming SQL Server
Backup to a file using management studio
copy file to different server
restore database using management studio
Depending on the database/version you may need to create the database before you can restore into it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Assuming you're using Sql Server Management Studio...
Right click the db you want to copy -> Tasks -> Back Up
Give the backup set a name (with .bak extension) and add a destination to save it to disk
Copy the backup to another server then Right Click the Databases node -> Restore Database
Add a name for the new db into the To database field and then select the From device radio button. Select your backup file and click the Restore tick box and then click OK.
This will copy the database to the new server.
|
|
|
|
|
I have several PictureBox Controls in my Form. I want to change the Image property of one of them depending on its Tag property. This is my code:
<br />
foreach(Control ctrl in this.controls)<br />
{<br />
if(ctrl.GetType().ToString() == "System.Windows.Form.PictureBox")<br />
{<br />
System.Windows.Form.PictureBox temPic = (System.Windows.Form.PictureBox)ctrl;<br />
if(tempPic.Tag="1")<br />
{<br />
tempPic.Image = someImg;
ctrl = tempPic;<br />
}<br />
}<br />
}<br />
Doing this I get an error:
<br />
Cannot assign to 'ctrl' because it is a 'foreach iteration variable'<br />
Is there any workaround for this or any ideas in order to achive this goal?
Any help would be apreciated
Ivan
|
|
|
|
|
Hi,
your code doesn't make much sense:
1.
the statement ctrl = tempPic; would do no good since tempPic already equals ctrl due to a previous assignment.
2.
why set a new value to ctrl, it is not used anywhere. (if you were to use PRE tags, see the "code block" button, you would have preserved the formatting of your code, making things much easier to read and understand).
BTW1: if(ctrl.GetType().ToString() == "System.Windows.Form.PictureBox")... is horrible; what you probably want is: if (ctrl is PictureBox)... or the "as" keyword (see below).
BTW2: your code will not compile, e.g. this.controls and ...Tag="1" are wrong
Maybe this is what you want overall:
foreach(Control ctrl in Controls) {
PictureBox pb=ctrl as PictureBox;
if(pb!=null && pb.Tag=="1") pb.Image=someImg;
}
I would like to suggest you buy a tutorial book on C# and study it; that will teach you all the basics in a structured and logical way, explaining the rationale and providing good examples.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
You left nothing for him
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
In this application I am playing with, I am generating a tabcontrol on the fly where each tab is a folder name in a directory. I am then dynamically adding a new DataGridView onto the new tab that was created and listing out the files inside of this directory (there are no sub directorys which is the reason I am doing it this way). This is all working file exactly like what I want except I can not figure out how to build a dynamic onrow click event because I have no idea how many tabs the application will have in the future. Can someone point me in the correct direction?
Listed below is the code that is looped through when adding the dataGrid to each tab (notice the name has the tabIndex).
DataGridView dataGridTicketInformation = new System.Windows.Forms.DataGridView();
dataGridTicketInformation.Name = "dataGridView" + tabIndex.ToString();
dataGridTicketInformation.Size = new System.Drawing.Size(401, 201);
// First we need to add a column
dataGridTicketInformation.Columns.Clear();
dataGridTicketInformation.Columns.Add("Name", "Name");
dataGridTicketInformation.Columns[0].Width = 301;
dataGridTicketInformation.Columns.Add("Data", "Data");
dataGridTicketInformation.Columns[1].Width = 100;
// Clear all the old Data first
dataGridTicketInformation.Rows.Clear();
|
|
|
|
|
I'm assuming you know how to add an event to the datagridviw
this.dataGridTicketInformation.DoubleClick += new System.EventHandler(this.GenericGridEvent);
GenericGridEvent would deal with the DGV getting the identity from the sender object
There is no RowClick event on the DGV, pick one of the other events to add.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If I have correctly understood what it is that you want to do.
Create a RowHeaderMouseClick event handler like this (I assume that this is the handler you want)
private void DataGridView_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
DataGridView dgv = (DataGridView(sender;
dgv.CurrentRow.Cells["Name"].Value = "Fred";
}
The same principle applies to any handler for multiple controls.
Then in the code that you posted, I dont think it matters where as long as it is after instantiation:
dataGridTicketInformation.RowHeaderClick += DataGridView_RowHeaderMouseClick;
BTW if the grid is disposed befor closing the app by using:
dataGridTicketInformation.RowHeaderClick -= DataGridView_RowHeaderMouseClick;
Hope this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Do you need to dispose of the event explicitly?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have had problems in the past that although I never managed to track down the exact cause, disappeared after doing so, so I always do now. I think it is recommended somewhere in MSDN too.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I am starting to use the 1 event for lots of controls, in VB you could just add the control to the Handle list, for things like turning the save button on after a value is edited, the event does not care about the sender just turns on the save button.
I presume I should dispose each event on each control when leaving the form!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: I presume I should dispose each event on each control when leaving the form!
If the Form will be Closed (i.e. Disposed) then it is not necessary.
Where I have used this method is for dynamically created controls, such as described by the OP. Where these controls are disposed but their parent control/form is still live, I detach the event handler.
I think the reasoning is that there will still be a reference to the disposed control, although convoluted, via the events mechanism. This will prevent it being Garbage Collected.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|