|
Actually that functionality was already there, but wasn't being used. I never did implement the whole caching thing, but I fixed so that only the object whose validation state changed was updated. The performance improvement was very dramatic. I'll probably try the caching next to see if I can get it to be really snappy.
|
|
|
|
|
I have a tab control that is part of a spit container. The tab control is in the upper panel and in the bottom panel there is a help field that displays info\rules for the current item.
I would like to fire one generic event on the enter of each item of the tab control that will populate the help field from the item.tag. I was hoping to get away from having to have an Enter event on each of the items in the tab page (there are over 200 items on the tab page). I would like to have one generic method that would fire when the user navigates to a new item. It would need to determine the current item and and get the tag for the item and repopulate the help field.
Any ideas on how to implement this?
TIA
New C# Developer!
|
|
|
|
|
Write a recursive method which hooks the Enter event of every control on each tab page. All of the controls' Enter events are handled by the same method. In that handler you can update the help info in the bottom container.
Josh
|
|
|
|
|
do you have an example? not quite sure how to implement as I am new to this framework.
|
|
|
|
|
This is what I had in mind:
private void Form1_Load(object sender, System.EventArgs e)
{
this.HookEnterEvents( this.tabControl1 );
}
private void HookEnterEvents( Control current )
{
if( current is TabControl )
{
foreach( TabPage page in (current as TabControl).TabPages )
this.HookEnterEvents( page );
}
else
{
foreach( Control ctrl in current.Controls )
this.HookEnterEvents( ctrl );
current.Enter += new EventHandler(OnControlEnter);
}
}
private void OnControlEnter( object sender, EventArgs e )
{
this.statusBar1.Text = (sender as Control).Tag as string;
}
Josh
|
|
|
|
|
Josh,
That is exactly what I was looking for and works great!
Thanks for your quick reply!
Bob
|
|
|
|
|
Hello everyone,
i'm working on a program that uses Crystal Reports.
How can i print the report without using the CrystalReportViewer control?
The only way i know to print a report is using that component and hit the print button on it. Is there another way without see the preview of the report?
Thanks in advance.
Enrico
VentoEngine corp.
Program your life ^^
|
|
|
|
|
i made an application that connects to microsoft exchange server, i can get and create appointments, but the problem is that i`m not sure how to edit an appointment without knowing its location on exchange server :https:\\server\user\inbox\file.eml. i see that every appointment has an uid, but i`m not sure how to use it.
thanks in advance
|
|
|
|
|
I have a context menu that contains a ToolStripTextBox control that I am using with a DataGridView. What I want to do is have the context menu appear when I right click on certain column headers and allow the user to change the text in the column header. The problem is that the columns I want to change are dynamically added to the DataGridView at runtime and for some bizare reason the ToolStripTextBox doesn't appear in that case. If I set the context menu at design time to the DataGridView I can see the ToolStripTextBox is there, but when I try it with the dynamically created columns it isn't. I even added a regular menu item to the context menu and that will appear on the dynamically added columns but the ToolStripTextBox is left out. Does anybody have any idea what is going on here? Is it a bug?
Here's the code where I add the columns:
DataGridViewTextBoxColumn dgvtbc = new DataGridViewTextBoxColumn();
dgvtbc.HeaderText = name;
dgvtbc.DataPropertyName = name;
dgvtbc.Name = name;
dgvtbc.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
dgvtbc.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
dgvtbc.DefaultCellStyle.Format = "f3";
dgvtbc.SortMode = DataGridViewColumnSortMode.NotSortable;
Padding newPadding = new Padding(0, 5, 0, 5);
dgvtbc.HeaderCell.Style.Padding = newPadding;
dgvtbc.HeaderCell.ContextMenuStrip = cmsIngHeaders;
dgvSamples.Columns.Add(dgvtbc);
table.Columns.Add(name, typeof(double)).DefaultValue = 0;
Thanks.
|
|
|
|
|
Hi,
I have created a web service that contains a fuction
[WebMethod]<br />
public int SavePersonInfo( object user )<br />
{<br />
WebBLL.User WebUser = (WebBLL.User)user;<br />
int Id = WebUser.RegisterUser( WebUser );<br />
return Id;<br />
}
when i call this fuction like this....
prashant1.Service1 mySer = new BLL.prashant1.Service1();<br />
int val = mySer.SavePersonInfo( this );
It's giving me error...
An unhandled exception of type 'System.InvalidOperationException' occurred in system.xml.dll
Additional information: There was an error generating the XML document.
Pls if anybody have any idea regarding this help me out...
Thanx & regards
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
-- modified at 9:47 Tuesday 2nd May, 2006
|
|
|
|
|
Is it maybe a serializable issue. Is your user object marked as serializable?
|
|
|
|
|
Yes it mark as a serializable.
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
i am working on windows form where
i have 7 dropdown list present. same items is get display in all dropdownlists
but my querry is that when i select any item in 1st dropdownlist...
remaining dropdownlists should not display that item. in this way if i select any item say surname in 2nd dropdown list that selected surname should not be present in remaing 6 dropdown list.
other dropdown list should display the data except the selected one from previous dropdownlist.
what i did is
i created an arraylist and fill the data in it...
On dropdown listclick i take the selecetd item
store it in string and remove that string from arralist
and bind the data in dropdownlist.
but its not working its going in infinity loop as well.
is there any other method to solve my problem...
Thanx,
meer
Software Developer
Pune.
|
|
|
|
|
|
sending u code sample
private void drpcity_SelectedIndexChanged(object sender, System.EventArgs e)
{ RemoveData();
}
public void RemoveData()
{
ArrayList arr = new ArrayList();
arr.Add("UserName");
arr.Add("City");
arr.Add("State");
arr.Add("Country");
arr.Add("Expertise");
arr.Add("AboutMe");
arr.Add("Rank");
arr.Add("Score");
if(drpuname.Enabled)
{
drpuname.DataSource = arr;
string str = drpuname.SelectedItem.ToString();
drpuname.Items.Remove(str);
}
if(drpcity.Enabled)
{
try
{
string str= drpcity.SelectedItem.ToString();
arr.Remove("str");
drpcity.DataSource = arr;
drpcity.Items.Remove(str);
}
catch(Exception ee)
{
string msg = ee.Message;
}
}
}
in this way 7 dropdownlist are used in coding like uname, city....
can anyone suggest solution for it
Thanx,
meer
Software Developer
Pune.
|
|
|
|
|
i know GDI is so slow but how does software as photoshop or fireworks use to do drawing operations?
|
|
|
|
|
without using .NET, thats for sure!
Photoshop and other graphics editing software is not written on the GDI library, they use native OS features and bespoke libraries.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
|
For example, I am a pretty certain the Adobe have their own (bespoke) image manipulation library used for Photoshop. They probably reuse it, in parts, for Photoshop Elements.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
how can i create a thing like that?
|
|
|
|
|
How to add menu to Window Form?
How to get height/width of the form?
|
|
|
|
|
You're seriously struggling with this?? Have you even tried?
Add a menu to the form by dragging an instance of MainMenu onto your form from the toolbox in visual studio.
As for your second question, and you may be massively surprised by this, a form has a Width and Height property
You may also like to read this[^]
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
You'll find MainMenu in the toolbox, in Designview of your form.
As for height/width of your form,
you can use this.Height and this.Width in the form-code.
('this' being the form)
-Larantz-
|
|
|
|
|
I am trying to use the Webbrowser control that is available in VS 2005 C# Express (.NET 2.0) to automate navigation through a set of web pages programmatically. I've run into two situations where I cannnot access the OuterHtml property of an HtmlElement. Looking at the debugger seems to say that some kind of underlying exception occurs.
1. I want to select an item in a listbox on a web page by changing the OuterHtml of two of the member elements from:
to
The attempt to remove the 'selected' string from the first entry fails completely and even messes up the entire listbox
2. I want to iterate through the frames on a web page to find the one I want to enter some text into. When I try to access (read, not write) the OuterHtml property of a frame to see if it is the one I want I see some kind of access violation in the debugger. Shouldn't this work?
Does it make sense to try to use the unmananged interfaces IHTMLDocument, IHTMLDocumet2, etc. when the Webbrowser fails like this? Can I mix the use of the Webbrowser control with use of the unmanaged interfaces?
|
|
|
|
|
My guess is that the managed web browser is failing because the underlying unmanaged browser is failing.
You can try though; you can mix the managed layer with the underlying native interfaces. You can do this by casting the webBrowser.Document.DomDocument object to IHtmlDocument2 and going from there.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|