|
i have tried but it didn't work i don't know why... it gave me a null value in the second form
|
|
|
|
|
it cant be
if you want i could post my project example for you
tell me if you want?
|
|
|
|
|
it worked finally .. i found the problem... i was declaring the public value in the parent form.... thank you very much
|
|
|
|
|
Hi,
I need an article on developing an Application which will provide a User interface for checking a Person Present Status in a Queue..
Task
*****
1.) Create a Common Window(Application) for all Computers in a LAN.
This Application is Used for giving tokens to persons in queue.
It also should Perform following things...
2.) Check Availability for the Person in Queue.
3.) Give the appropriate Queue Number.
4.) Call the appropriate number (Audio Signal)of the person
when he gets his turn.
|
|
|
|
|
All we can say is to break the problem down into smaller parts and do research on each of those parts. You're not going to find an article that exactly and specifically follows your specifications.
|
|
|
|
|
Can Any One Help,
I am trying UI AUTOMATION for OUTLOOK 2007 using C# .Net 3.0 (using System.Windows.Automation;)
My Requirement's are mentioned below.
1) Open Outlook 2007
2) Open Inbox
3) Select first unread email.
4) Open the first unread email.
5) If there are attachements, download the attachements.
6) Select next unread email and do the same as above.
I can open the OUTLOOK 2007, But I am getting NULL value while Searching Inbox using PropertyCondition.
PropertyCondition pc = new PropertyCondition(AutomationElement.NameProperty, name);
return parent.FindFirst(TreeScope.Descendants, pc);
Here are the Code,
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Automation;
using System.Windows.Automation.Provider;
using System.Threading;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Forms;
namespace AmmeaBahavathi
{
class OutLookUIAutomation
{
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")]
private static extern bool IsIconic(IntPtr hWnd);
private const int SW_RESTORE = 9;
static void Main(string[] args)
{
Process[] processes = Process.GetProcessesByName("outlook");
AutomationElement aeOutLook = null;
Process proc1 = new Process();
if (processes.Length == 0)
{
proc1.StartInfo.FileName = "outlook";
proc1.Start();
proc1.WaitForInputIdle();
Thread.Sleep(5000);
aeOutLook = AutomationElement.FromHandle(proc1.MainWindowHandle);
}
else
{
proc1.Close();
IntPtr hWnd = processes[0].MainWindowHandle;
if (IsIconic(hWnd))
{
ShowWindowAsync(hWnd, SW_RESTORE);
}
SetForegroundWindow(hWnd);
}
if (aeOutLook != null)
{
Thread.Sleep(1000);
AutomationElement aeNew = FindAutomationElementByName(aeOutLook, "Inbox");
if (aeNew != null)
{
Thread.Sleep(5000);
InvokePattern ipNew = aeNew.GetCurrentPattern(InvokePattern.Pattern) as InvokePattern;
ipNew.Invoke();
}
else
{
Console.WriteLine("aeInbox:Null");
}
}
else
{
Console.WriteLine("aeOutLook:Null");
}
Console.ReadLine();
}
public static AutomationElement FindAutomationElementByName(AutomationElement parent, string name)
{
PropertyCondition pc = new PropertyCondition(AutomationElement.NameProperty, name);
return parent.FindFirst(TreeScope.Descendants, pc);
}
}
}
Thanks,
Bruze
|
|
|
|
|
If Outlook is running before your process starts you get into the first else block and aeOutlook is never set.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
I am getting aeInbox:Null
|
|
|
|
|
Hi,
I'm want to access all the running services in a remote machine in different username and password.
I know, I know the connection options and Management query to access the services but i dont what is the MANAGEMENT SCOPE to be used for this query, need help on this.
Thanks,
D.Vinoth
|
|
|
|
|
Hi,
I need an article on developing custom user control in c# (not trivial one) from the very beginning to the final product. It must include "full" UML (not only class diagrams) support which is main reason for this post (since there are plenty of excellent control examples on CodeProject).
Thank you in advance!
|
|
|
|
|
matixsc wrote: I need an article on developing custom user control in c# (not trivial one) from the very beginning to the final product. It must include "full" UML (not only class diagrams) support
Chances are very less to find one like that. Why don't you start developing and search for specific help?
Best wishes,
Navaneeth
|
|
|
|
|
matixsc wrote: I need an article on developing custom user control in c# (not trivial one) from the very beginning to the final product.
Microsofts' Component Authoring Walkthrough[^]?
I are Troll
|
|
|
|
|
Very usefull resource but, certainly, not the tutorial. Thank you anyway.
|
|
|
|
|
Hello all,
I have a windows application which updates multiple rows (using a stored procedure in the db) in a SQL Server database, but this updates run many times sequentially in a for loop.
For the update methos I have tried the following methods:
- The SqlCommand object running my stored procedure as a text commnand and executing it with the ExecuteNonQuery method.
- An SqlDataAdapter using its UpdateCommand attribute and executing using the ExecuteNonQuery method.
In both ways the running time is really slow.
Can anyone suggest me an other way to do the updates. It would be good if I could save my updates n a dataset or a datatable and after save it to the db.
Thanks in Advance
Dimitris
|
|
|
|
|
Are you just updating rows, or are you inserting new ones and deleting them too?
One approach you might consider is rather than repeatedly calling an update proc, instead insert each modification into a temporary table and then call a proc which would do the update in one single atomic shot.
The advantage of this would be that you could bulk load that temporary table really quickly.
If that's too much, have you 'prepared' the proc so that you just change the value of the SqlParameters rather than create new ones each time?
Regards,
Rob Philpott.
|
|
|
|
|
Thank you Rob,
Actually my stored procedure has a double functionality.
Updates rows in my table (depending on a key) and in case of non existing rows it inserts them.
I haven't tried to bulk insert in a temp table and after update mine because I have to do this many times and I'm afraid that it would be realy time consuming to do this every time, because every time I should delete the temp table.
That's why I would like to fill somehow a datatable in the memory and after my insert/update queries (maybe without using stored procedure) to update this in the db.
Thanks again,
Dimitris
|
|
|
|
|
I wouldn't be too concerned about the overhead of creating a table each time, this would be far more effecient than multiple calls to an update proc. AFAIK, there isn't really a way to bulk update a database, but you can bulk insert into it very quickly.
So, if you did want to try this approach, create a new prepare proc which creates the table, use the SqlBulkCopy class to rapidly write to this, and then call a commit proc which updates and inserts based on this table and deletes it afterwards.
Regards,
Rob Philpott.
|
|
|
|
|
Yes maybe you are right.
I have tried I think everything else.
So I'll try this solution.
Thank you very much for your help Rob
|
|
|
|
|
I use a parameterized statement with ExecuteNonQuery, usually with a transaction.
|
|
|
|
|
Hi,
I have listbox and im retriving text in listbox by selection.
When i selected item, the SeletionChanged function get invoked twice.
private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string str = (String)listBox1.SelectedItem;
listBox1.SelectedIndex =-1;
}
When i set breakpoint in bolded line first time it shows "",then when i press F5 it again comes to that place and shows the correct Text.
I want to get the text in first execution itself.
Anu
|
|
|
|
|
Several Controls fire their XxxChanged event more than once; AFAIK the exact behavior isn't documented, so you can't rely on it, nor rightfully expect a particular behavior. You can think of it as: in a first step the current selection gets unselected, then the new selection becomes in effect.
You will have to cope with such behavior; having the first event with an empty selection should make that not too hard.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
hi,
listBox1.SelectedIndex =-1 will raise the SelectionChanged event too, because the current selection changed to -1.
check on the selectionchangedeventargs if the new index is -1 to return before doing the stuff you want to.
greetz
|
|
|
|
|
Yes you are correct.
When i comment that listBox1.SelectedIndex =-1 line,when i work its works fine.
But i want to deselect the selected item after i seleted that.
How can i do that?
Because after selecting,the selected item is in blue color.I dont want tht.
Anu
|
|
|
|
|
Hi everyone,
Does anyone knows how to get shared folder sharing permission for certain user name or group? For example, for username "Everyone", how do get the info whether the sharing permission is Full Control, Change or Read?
Thanks in advance
|
|
|
|
|
There are classse called DirectorySecurity and DirectoryInfo . Although I haven't done this but I think one of them should provide this information.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|