|
I have no idea myself, but it sounds as though the IHtmlDocument interface requires a Form in order to work. Since services do not expose forms or a message pump, I think you're not going to get it to work.
|
|
|
|
|
hi...
can u give me solution for it?I am stuck with this problem since 2 weeks.
Please give me reply asap.
Thanx and Regards
Sonal Patel
|
|
|
|
|
Well, first, don't use IHtmlDocument. Next, I have no idea what you're doing with the page that comes back so I really can't tell you a proper solution.
|
|
|
|
|
Hi,
I am developing a live support application operator console using .net windows forms.
Now in this application it's very important to show the current info in fastest way.
I am showing all the users on site in a list-view control and to show the updated status of online users I am refreshing the list-view control's content by every second.
Now when user will click on any listview record, it will show the details of user ( chat script, geographical info,navigation info) in the bellowed panel.
It works quite fast when it is on my machine. But when I m using the remote database it's TOO SLOW
Now ,
1. What I can do to improve performance ?
2. Shall I go for threading ?
I tried to use use threading like
private void timer_refresh_Tick(object sender, EventArgs e)
{
Thread _timerTickOp = new Thread(TimerTickOperations);
_timerTickOp.Start();
}
private void TimerTickOperations()
{
try
{
UserFacade facade = new UserFacade();
Operators _currentOperator = facade.GetOperator(LoginForm.LoggedInOperatorName);
FillUsers(toolStripCbox_Filter.SelectedIndex);
.....
}
but I m getting err 'Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on.'
What should I do to improve performance?
|
|
|
|
|
Hi,
I explained the cross-thread problems in this article[^].
In your particular case, you might consider using a Windows.Forms.Timer instead of your current timer class, as the former ticks on the main thread, hence won't show any cross-thread problems. If that results in a GUI that isn't sufficiently responsive (because your database accesses take too long), then you need to use another kind of timer and apply the InvokeRequired stuff from the article.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Threads give you more processing power, but it sounds like your bottleneck is the database. Some suggestions for you to explore;
* Check your database-indexes, that's the number one suspect in slow databases.
* Check your SQL-statements in a profiler, using the same amount of data as on the remote server.
* Check whether you can move some of your data/work to a local database.
* Check the remote server; it will be terribly slow if there's little virtual memory left.
Sometimes you can't make it faster. In that case, whip up a form to show the current progress and status. Or better yet, show it as a tray-icon, similar to Windows Update.
Good hunting
|
|
|
|
|
I am new to dotnet. I have an application with one login screen and three other screens. On login user can go to any of the other three screens by selecting the options. On all three screens i have a Picture box which i need to update the Image every one minute based on some logic.Can you please help me on how to do it using one thread in main form.
Note: I have a base form, all the forms are inherited from Baseform
User can go only to one form at a time
Using VS2003
|
|
|
|
|
Try the Timer class[^], which allows you to trap an event at regular intervals based on the clock.
|
|
|
|
|
It is probably wiser to use a Windows.Forms.Timer, as this one ticks on the main thread, avoiding all possible cross-thread problems while accessing Controls.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hello, i want to make the my button's shape as its backgrounds's shape .... i.e if the background image is triangle the button will take that shape ... inshort i dont want to see the button ... just the image as a button ... thank you(I am working on C#)
|
|
|
|
|
See this[^] article. Might help.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Thank u for ur help..... But the code i get is not runnable ... i.e and i wanna c the effect .... How can I see that .... it is a little bit odd to me ... may b i dont know too much ...
thank u 4 ur help.
|
|
|
|
|
You may have already solved your problem, but if not, take a look at this[^] article. It may help you.
I found this by Googling c# shaped controls, in case it is not quite right for you.
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.”
|
|
|
|
|
Please try writing in proper English, it takes not much more time than using things like "wanna c" for want to see, and ur for your.
|
|
|
|
|
Greetings,
I have a control that inherits from GroupBox and contains some other default controls and behavior. I am trying to override the GroupBox Text property so the text appears in a label in the GroupBox, and have the GroupBox text itself be an empty string. However, when I set the Text property in the designer, both my label and the GroupBox show the same text. What am I missing? I am using C# 2.0 using VS 2005 (I haven't upgraded to VS 2008 because I need at least the Standard edition for building my installers, and upgrading to VS 2008 Standard or Pro is not in the budget at the moment).
public class ExpandableGroupBox : GroupBox
{
public ExpandableGroupBox()
{
base.Text = "";
}
public override Text
{
get
{
return label.Text;
}
set
{
label.Text = value;
}
}
}
Thanks,
Dybs
|
|
|
|
|
Did you copy the source from your Visual Studio direct in here?
If it's like that, you won't be able to compile the code anyway, because you are missing the type of your Text property
public class ExpandableGroupBox : System.Windows.Forms.GroupBox
{
public ExpandableGroupBox()
{
base.Text = "";
}
public override string Text
{
get
{
return label.Text;
}
set
{
label.Text = value;
}
}
}
hack the planet
|
|
|
|
|
No, I typed it from memory, and lack of sleep was setting in. I do have the type in the actual code and it compiles. (If it didn't compile, I couldn't really complain about both my label and the GroupBox showing the same text ).
Dybs
|
|
|
|
|
I have no idea why your code is not working. I would probably tried something similar.
However, take a look at this article[^] (it's got some pretty pictures). Is that the sort of thing that you want?
If not, I found that by Googling c# override text of groupbox, there were lots of hits including UXTheme'd GroupBox control[^], from here on CP. I haven't read it but it might give you some ideas.
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.”
|
|
|
|
|
Henry,
Thanks for the links, but the article's aren't quite what I'm after. What I'm trying to make is a GroupBox that will expand/collapse when a header is clicked. In my case I'm using a ToolStrip at the top of the GroupBox , and I want the ToolStrip's label to show the Text property instead of the GroupBox . Rather than inherit from UserControl and do everything by hand, it seemed reasonable to inherit from GroupBox and just override the Text property, and add the expand/collapse behavior.
I've almost got it working now. I tried using new instead of override for the Text property, and it gives me the desired effect, but the value I set in the designer doesn't show up when the application run. It only shows me the default value. It's the same situation described here[^]. The value is not being written to the InitializeComponent method for my form. I tried setting the DesignerSerializationVisibility attribute to Visible , but that didn't work. I've looked at the other attributes listed on MSDN[^], but I don't see any others that I know would help. Here's what my code looks like now:
public partial class ExpandableGroupBox : GroupBox
{
public ExpandableGroupBox()
{
InitializeComponent();
base.Text = "";
}
[EditorBrowsable(EditorBrowsableState.Always), Browsable(true),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
Bindable(true)]
public new string Text
{
get
{
return toolStripLabel1.Text;
}
set
{
toolStripLabel1.Text = value;
}
}
}
After some more searching, it looks like I may be able to use something like DevExpress's XtraNavBar[^]. However, I'd still like to figure this out just for my own curiosity. Things like this bug me to no end...
Any more help would be greatly appreciated.
Dybs
|
|
|
|
|
A while ago I wrote an article on Nested Controls (which is what the controls inside a GroupBox are) and their design time behavior.
I don't know if you feel that it might have relevance to your situation, but have a look and see. Here is a link Designing Nested Controls[^].
Hope there is something useful in there for you.
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.”
|
|
|
|
|
Great article! I ran into this problem with a TableLayoutPanel awhile back (we made the panels all resizable at runtime) and we couldn't figure out how to drop controls into the different panels at design time. This is exactly what we need. Great set of resource links, too. I'll play around with the designer stuff tomorrow and see if I can bend it to my will.
Thanks,
Dybs
|
|
|
|
|
I finally got it to work. I added the Category and DefaultValue attributes, in addition to the code above, and now it's working. Not sure why that would have affected it but hey, I'll take it. Thanks again.
Dybs
|
|
|
|
|
Good stuff!!
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.”
|
|
|
|
|
Where can I learn more about MyNeoReports? I have a need to develop an app that builds an internal dataset and creates a viewable/printable report. Therefore, I need to build the report completely at runtime without a pre-defined design. It appears as if MyNeoReports will work, but I can't find a tutorial or detailed example code anywhere to point me in the right direction. Any help will be greatly appreciated.
|
|
|
|
|
Does A New .NET Reporting Way[^] not help?
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.”
|
|
|
|