|
Your problem is that you are starting a new iexplore process each time.
|
|
|
|
|
Mertli Ozgur Nevres wrote: System.Diagnostics.Process.Start(
"iexplore.exe",
As a Firefox user I tell you: Don't - do - this - EVER!
Starting the link directly is okay on windows, windows will take care of it itself.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all,
I have a problem with the ListBox Control. Let me first explain my application:
I have here a UserControl (contains list box and dataGridView) and form called AttendanceScreen (which reposibles to send data from database to UserControl). In additon, that form includes that UserControl.
So when the form loaded which contains the userControl, it will send dataSet to the userControl as data source for the listBox.
And when the user select any item from the listBox that event will be triggered by selectedValueChange. The handler of that event will be responsible about sending the value of selectedItem to the form by the Association relationship.
And my problem is located in this moment.
the excaption message said -> "NullReferenceException was unhandled by user code"
My code here:
userControl Class::
<br />
private void employeeListBox_SelectedValueChanged(object sender, EventArgs e)<br />
{<br />
if (IsReleased)<br />
{<br />
attendScreen.employeeAttendanceTriggered(int.Parse(this.employeeListBox.SelectedValue.ToString()));<br />
}<br />
}<br />
<br />
when I tested by MessageBox like
<br />
private void employeeListBox_SelectedValueChanged(object sender, EventArgs e)<br />
{<br />
if (IsReleased)<br />
{<br />
MessageBox.Show(this.employeeListBox.SelectedValue.ToString());<br />
}<br />
}<br />
<br />
it works fine. so where's the problem
*
I forgot to include that when I have tried to do everything in userControl (connecting to database and retrieve data and then displayed in dataGridView, it works fine for the dataGridView BUT all items in ListBox disappeared - no more selectedValueChange event fired)
*
Thanks in advance.
|
|
|
|
|
|
|
iam working in c# on stress testing tool,for this i have to track and record user activities performed by user after opening webpage .i need help in code form.
|
|
|
|
|
2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
|
|
|
|
|
I love your screen name.
Have you seen this thread? [^]
|
|
|
|
|
do you have any idea about hooks in VC?
you can track the activities of a user by using hooks. just read about how to implement hooks in c#.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Hello
Let's say I have two forms, form1 and form2. Form1 have only one button and now each time I click this button form2 should show in the front of form1.
Well whats the best practice in doing such thing ? I mean I can create
one instance of form2 in the form1's constructor and then use only
Show() and Hide() methods of form2 or create new instance of form2
each time i click button on form1.
I'm not sure if my problem is clear enough . Let me now if you need more details.
greetings
tommy
|
|
|
|
|
It all depends on what you want to do with your form.
Check Form.BringToFront() method
|
|
|
|
|
Can't you show it as modal?
|
|
|
|
|
Hi...
I want to read a string from a dll & i want to print it in a rich text box on windows form.
How can i do this...?
How i can define a function which will return a string in dll file so that i can call that function from my form class & get the string to display on form...?
Thanks,
Vinay
|
|
|
|
|
Erhmpff... this is really back to basic...
Create a solution with two projects
- Executable project (name : ExeProject)
- Class library (name DllClassLibrary)
in the class lib. create a class containing the following function :
public string MyRichText()
{
StringBuilder sbMyText = new StringBuilder();
sbMyText.Append("Text text text and even more text");
return sbMyText.ToString();
}
Then from your executable project, create a reference to the class lib and add a form containing a textbox. Name the textbox for instance txtTextFromDll
In the Load event of your form add the following lines :
DllClassLibrary.ClassName objMyClass = new DllClassLibrary.ClassName();
txtTextFromDll.Text = objMyClass .MyRichText();
you're pretty done there (except for when i miss something)
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
Hi
How can i initilize if screen resolution changed?
I want to do some actions when screen resolution changed.
Help me please...
|
|
|
|
|
Hello,
Microsoft.Win32.SystemEvents.DisplaySettingsChanged += newEventHandler(this.DisplayChanged);
public void DisplayChanged(object sender, EventArgs e)
{
}
should do it.
Hope that helps.
All the best,
Martin
|
|
|
|
|
Hello Martin
You are cool!
You solved my problem ontime (fast, easy, complete);
My problem is controlling form object size in order to monitor resolution,
briefly "Auto Resizing Form Controls".
I couldn't solve this problem with "Dock" and "Anchor" properties.
Anyway, Tanx.
Regards.
|
|
|
|
|
I'm happy if you are! :->
|
|
|
|
|
I am new to C# you are requested to please guide.
I have very simple application.
1. Main Menu (File: Open, save, exit);
2. A tree view
3. Context Menu and ImageList
I have loaded xml file using open dialgoue. With XmlTextReader I have loaded xml file in tree view.
Please guide me from here below:
Now I want to add a context (pop-up) menu. That will enable me to add a node under three categories:
1. Before Node (Same level)
2. After Node (Same Level)
3. Child Node
If root node selected I would be able to ADD only child node in the tree. Means contextMenu will show only child enabled.
If element node selected I would be able to add before, after nodes or a child node. (Before and After creates element on same level under root).
Also I want cut, copy and paste functionality in context menu. That will enable me to cut, copy and paste nodes.
Save in MainMenu will enable me to save changes in according to tree modification.
Please tell me by examples. What steps should be taken? Waiting for your reply.
If user right clicks on node context menu appears and user select appropriately from enable menu for the selected node.
-- modified at 8:28 Tuesday 14th November, 2006
|
|
|
|
|
Thank you for letting us know that. Did you have a question you wanted to ask?
|
|
|
|
|
now check again please.
|
|
|
|
|
Well if you create a ContextMenu(Strip) which you assign to the treeview. There's an event for that which is fired when the menu is displayed (can't remember the name of it).
If you handle that event then you can decide which menu items to display. Then when a menu node is clicked you need to decide which context it's been fired in (i.e. sub node etc) and perform the appropriate actions.
To copy / paste the treenodes I'm not sure how to accomplish this at the moment using the clipboard (easily anyway), if it's to be handled by the program then you could just store a copy of the code in a local variable and delete it from the tree and move it to the appriopriate place.
|
|
|
|
|
This is ugly ugly code but ...
Uses a TreeView treeView1
ContextMenu cMenu;
int count;
public Form1()
{
InitializeComponent();
cMenu = new ContextMenu(new MenuItem[]
{
new MenuItem("Add before", new EventHandler(mi_Click)),
new MenuItem("Add after", new EventHandler(mi_Click)),
new MenuItem("Add child", new EventHandler(mi_Click))
});
treeView1.Nodes.Add(createNode());
}
private TreeNode createNode()
{
TreeNode tn = new TreeNode("Node" + (count++).ToString());
tn.ContextMenu = cMenu;
tn.ContextMenu.Tag = tn;
return tn;
}
void mi_Click(object sender, EventArgs e)
{
MenuItem mi = (MenuItem)sender;
TreeNode sourceNode = (TreeNode)mi.Parent.Tag;
switch (mi.Parent.MenuItems.IndexOf(mi))
{
case 0:
if (sourceNode.Parent != null)
sourceNode.Parent.Nodes.Insert(sourceNode.Index, createNode());
break;
case 1:
if (sourceNode.Parent != null)
sourceNode.Parent.Nodes.Insert(sourceNode.Index + 1, createNode());
break;
case 2:
sourceNode.Nodes.Add(createNode());
break;
}
}
|
|
|
|
|
I am a newbie to C#. I was trying to refresh a drawing in a UI panel. Can I set a timer to call itself after 1 second? The event type is a PaintEvent and I don't know how to call this event.
If anyone could help I would be grateful.
|
|
|
|
|
Hello,
You could use Invalidate or Refresh.
All the best,
Martin
|
|
|
|