|
|
I need to convert any text entered by a user in a combo box to upper case. So, in the text_changed event, I added the code to convert the text to upper. However, the first time I select the combo box and change the text, it doesn't register the changed text, but the text that was previously present in the combo box (what is loaded into it during the form load event). Is there a reason for this and how do I correct it? Thanks.
|
|
|
|
|
I am creating a round edge panel by inheriting from the panel. What I do is create a graphics path with desired shape and in the Paint method I fill the graphics path and draw the graphics path border with desired color. This would look as if the panel has round edges. So far I have not set the region. Bounds of the panel is still the rectangle.
But the problem come when I set the region of the panel to the Graphics path region. It would not draw the borders( especially left and bottom) properly, it would not draw the curves properly. Also if I set the background image , the image is not smooth along the borders even though I set smoothing mode to AntiAliasing .
Any ideas on why it is behaving this way would be greately appreciated.
Here is the code in Paint method
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
Graphics gr = e.Graphics;
gr.SmoothingMode = SmoothingMode.AntiAlias;
if(_roundedCorners)
{
// clear background with the parent's backcolor before drawing the round edges
if( Parent.GetType() == typeof(RoundEdgePanel))
gr.Clear( ((RoundEdgePanel)Parent).PanelBackColor);
else
gr.Clear(Parent.BackColor);
gr.DrawPath(_borderPen, _roundedEdge);
// now fill with actual color
gr.FillPath( _graphicsPathBrush,_roundedEdge);
// setting the region of the control
//this.Region = new Region( _roundedEdge); // this is where the problem comes
}
else
{
// set the back color to the color of _graphicsPathBackColor
gr.Clear( _graphcsPathBackColor);
gr.DrawPath(_borderPen, _squaredEdge);
//gr.FillRegion( _graphicsPathBrush, this.Region);
}
}
Thanks,
VpMahank.
|
|
|
|
|
Hi
I am using crystal report to display the report. I am able to do that on my workstation where crystal report is installed.
Now I have to deploy my application on another machine(user machine) which does not have crystal report installed. Is their anyway I can still display report to the user on user machine or I need to install crystal report on user machine first?
Any help would be appreciated.
Thanks
|
|
|
|
|
Crystal_Database_Access2003.msm
Crystal_Database_Access2003_enu.msm
Crystal_Managed2003.msm
Crystal_regwiz2003.msm
Add there Merge modules in setup project and 4th merge module require license you can copy that license from About dialog of MS Visual Studio IDE
Thanks
SANTOSH SATALKAR
Sr. Software Engineer
Sino India GTT Shouguang,
Weifang Area, Shandong PRC,
CHINA.
Ph. 00865365196745
http://www.gtt-sinoindia.com
-- modified at 5:15 Wednesday 4th January, 2006
|
|
|
|
|
|
I have a public class constructor that reads a file's content. If the file does not exist or the file name/content is wrong, it raises an ArgumentException. I'd like the constructor to return a null object on an exception ie
MyClass mc = new MyClass(string filename);
mc is a valid object if the filename and content is OK, otherwise its null. At present I can create a partially instantiated object, check if a property is null, and fix the problem, but this is inelegant.
Is there a way to do this or am I out to lunch?
Suggestions?
|
|
|
|
|
Out to lunch. You might want to look at the Abstract Factory design pattern [^] to get what you want.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi sjdevo3gsr,
do one thing, simply put your constructor code in try catch Block. Here make sure htat take many catch blocks. like this
try<br />
{<br />
}<br />
catch(ArgumentException argEx)
{<br />
}<br />
catch(Exception ex)
{<br />
}<br />
regards
GV Ramana
-- modified at 14:48 Tuesday 3rd January, 2006
|
|
|
|
|
use the factory pattern for this;
declare a static function that returns this class initialized returning null and use this function instead of new operator.
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
In C++, you could overload the new operator, but you can't do anything similar with C#.
|
|
|
|
|
for example in this site :
http://www.google.com/advanced_search?hl=en
how i can choose an option in any of the multiline combo boxes?
like Language, File Format.....
i mean for example in Language i wanna select some language
and in file format i wanna select pdf
thx in advance....
|
|
|
|
|
Hello vedmack,
If one form contains many comboBoxes,
get SelectedValue of each Combobox and do your operations as per the your requirment.
regards
GV Ramana
|
|
|
|
|
i tryed something like this...
HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
HTMLInputElement combo= (HTMLInputElement) myDoc.getElementById("xxx");
combo.value="Arabic";
combo.click();
but its not working....
any ideas?????
|
|
|
|
|
What I'm trying to do in psuedo code
<br />
foreach( item sourceItem in sourceList)<br />
if (destList.Count == 0)<br />
destList.Add(sourceItem)<br />
else<br />
foreach (item destItem in destList)<br />
if (Conditions(...))<br />
AddAndManipulateExistingItems(...)<br />
else destList.Add(sourceItem)<br />
AddAndManipulateExistingItems() adds 1 or more items to destList and may modify sourceItem and existing items destList. Source list is not kept past this code snippet so modifying it doesn't matter. The algorithm itself is from a vba excel app and is sufficiently complex that I don't want to risk hunting down any side effects burried in several thousand lines of implementation.
My first attempt to do this was done using ArrayLists, but the modifications are breaking the foreach loops and causing InvalidOperationException's. IS there a collection that will let me do this, or will I have to use arrays and resize manually?
|
|
|
|
|
The foreach construct uses an Enumerator to step through the list. If you alter the list, the Enumerator is invalidated. You can loop through the list as long as you don't use an Enumerator, for an example using a regular for loop:
for (int i=0; i<sourceList.Count; i++) { ... }
---
b { font-weight: normal; }
|
|
|
|
|
Thank you. I was sure there had to be a way to do that.
|
|
|
|
|
how can i dial an internet connection using C# when a button is pressed on my form. I have a number of Broadband and Dial Up Connections on Windows XP OS.
|
|
|
|
|
Im really sorry about posting the message thrice. It was an accident.
|
|
|
|
|
how can i dial an internet connection using C# when a button is pressed on my form. I have a number of Broadband and Dial Up Connections on Windows XP OS.
|
|
|
|
|
how can i dial an internet connection when a button is pressed on my form.
|
|
|
|
|
Hi,
I want to use WebClient or HttpWebRequest download file. Everything is fine.
My question is: How can I know the internet connection is broken when I am downloading a big file. Rightnow the programm is just wait overthere, I don't know how long it take for the waiting.
I want to cancel the download once the internet connection is broken. and do some cleanup for the download.
Please help me!!
Thanks a lot!
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
Set the timout for the request to a lower value, perhaps just a few seconds.
An alternative is to make an asynchronous request instead.
---
b { font-weight: normal; }
|
|
|
|
|
I setup the request timeout already.
the problem is, I send the request, and it (request) returns a response already. the "timeout" happends at when I deal with the response.
Alan Shen
MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
|
|
|
|
|
What do you mean? If you already have gotten the response, what does it have to do with the internet connection?
---
b { font-weight: normal; }
|
|
|
|