XML in DataGridView Q?
Hi all,
I have a DataGridView that displays an XML file in it... the table has
these column names: Name, Value, Data. After I've populated it I need
to compare (via a method call) the data in the Name cell with the
string value in the XML comment. So basically I'm comparing the Name
cells value with the comment value in the XML file.
The XML file contains the useual <name>, <value> & <comment> tags.
How would I do that? Also I want to color the cells Name & Value if
they do not match?
private void SeeForMatch()
{
XmlDocument doc = GetXmlDocument(); // loads XML file
DataTable dt = datagridView1.DataSource as DataTable;
foreach (DataRow rows in dt.Rows) // loops through the
datagridview1 or should I use:
// foreach
(DataGridViewRow rows in dt.Rows) 'cos I need the cell coloring
{
string name = (string)rows["name"];
foreach (XmlNode node in doc.SelectNodes("//data")) // loops
through the XML file
{
if (node.Attributes["comment"].Value.Equals(name)) // !!!
// should be if ( the string value in the cell not equal to
the <comment> value in the xml file)
// { color both cells & check the rest of the name column
with the XML <comments> }
I know if I wanted to color the cells I would use:
rows["name"].Style.BackColor = System.Drawing.Color.Blue; //assuming
rows was a DataGridView but it's DataRow type!!
Thanks for your help ppl. Tag: Insert row in datagridview Tag: 107000
C# Windows Applications
Hi All,
I read article
(http://msdn.microsoft.com/msdnmag/issues/05/08/AutomaticProxyDetection/default.aspx). I need yours help. Please advise me
My Requirement is given below.
This is C# windows .net application(application as i need *.exe file
rather than install file ) which has 4 textboxes (tbxURL for URL in URL
Frame, tbxAddress for address in Proxy server frame, tbxPort for port in
proxy server frame, tbxProxyScript for proxy script in proxy script frame)
and a test button. The requirement is given below
STEP BY STEP GUIDE
1. Input the URL you want to test
2. Choose Proxy script/Proxy server with Address and Port Information/No proxy
3. Enter url to proxy script or info for proxy server in respective text box.
4. Press test-button
e.g.
A) Proxy Script (Textbox):
http://www-proxy.ericsson.se:3132/accelerated_pac_base.pac
B) URL (Textbox): any URL which starts from https://
C) Proxy Server (2 text box one for Address and one for Port):e.g.
10.187.1.20 and 8080
The below code is working fine for url (only URL, No Proxy Server i.e.
Address and Port, no Proxy Script), URL with Proxy Server (Address, Port) as
given in coding but not for URL AND Proxy Script, That code needs to be
changed.
so my question is how to do coding for calling URL when you want to access
that URL(mentioned in the textbox on the window form) with proxy
script.(which is filled in the textbox present on the window form. Please
advice (for yours reference, I am giving you the code which I put, this code
is filling my 2 requirements (URL alone), URL with address and port) out of
total3 (URL alone, URL with address and port, URL with proxy script only)
Ã?-----------------------------------------------------------------------------My
Code is given
below-------------------------------------------------------------------------------------------------------------------------------Ã
private void Calc_Time_For_URL()
{
if(tbxURL.Text.StartsWith("https://"))
{
//Time of Request
DateTime dt1 = DateTime.Now;
try
{
System.Net.HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(tbxURL.Text.ToString());
//Proxy Server(Address and Port)
if ((tbxAddress.Text.Length > 0) &
(tbxPort.Text.Length >0))
{
myReq.Proxy = new
WebProxy(tbxAddress.Text,Convert.ToInt16(tbxPort.Text));
}
//Proxy Script
if (tbxProxyScript.Text.Length > 0)
{
Ã?--------------THIS CODE IS WRONG AND NOT
WORKING AND NEEDS TO BE CHANGED
// Create a new Uri object.
Uri newUri=new Uri(tbxProxyScript.Text);
// Associate the newUri object to
'myProxy' object so that new myProxy settings can be set.
myReq.Proxy = new WebProxy(newUri);
-------------------------------------------------Ã
}
//GetResponse for this request.
HttpWebResponse response =
(HttpWebResponse)myReq.GetResponse();
//Time of Response
DateTime dt2 = DateTime.Now;
lblTimeTaken.Text =
Convert.ToString(dt2.Subtract(dt1));
//}
}
catch(System.Exception ex)
{
//Time of Response
DateTime dt3 = DateTime.Now;
lblTimeTaken.Text =
Convert.ToString(dt3.Subtract(dt1));
string message = "Make Sure URL is enterted
with http://www or https://www as prefix as per your
need!!!\nError returned is :\n " + ex.Message;
string caption = "Error!!!";
DialogResult result;
MessageBoxButtons buttons =
MessageBoxButtons.OK;
result =
MessageBox.Show(message,caption,buttons);
}
My Doubt is should we have to call any API..?Actually there is one exe file
named â??proxycfg.exe" inside C:\windows\system32
Thanks,
Deepak
+919886735837
kr_deepak123@hotmail.com
kr_deepak123@yahoo.co.in
kr_deepak123@skype.com Tag: Insert row in datagridview Tag: 106995
GUI Designer Tool
Is there a software with which you can design and click together a XAML GUI
and instantly
become a feedback how the GUI looks?
Thx in advance
A.Gallus Tag: Insert row in datagridview Tag: 106994
Save / Restore : size and position of the form
Hello,
How can I save and restore the position and the size dive by a user and
restore them next time I start my application ?
Thanks, Tag: Insert row in datagridview Tag: 106986
Move two Forms simultaneously
HI!
My first post, so Hello there!
I=B4m trying to develop an apllication with docked forms, like in
Winamp. If a child forms is docked to the parent form it should move
and resize like the parent form does.
I=B4ll give you an simple example of how I tried to archive this:
Form parent =3D new Form();
parent.TopMost =3D true;
Form child =3D new Fom();
parent.Move +=3D new EventHandler(parent_move);
void parent_move(object sender, EventArgs e)
{
child.Bounds =3D parent .Bounds;
}
This example is not very usefull, because the parent form will
completly cover the child, but it shows my problem: The child form
moves slowlyer. Moving the parent form will cause the child form to
move, but with a delay of time. I want them to move as if they where
ONE form!!!
I was seraching for days now, tried serveral Win32 Api calls regarding
moving but I didn=B4t get it!
Can anyone help me? Tag: Insert row in datagridview Tag: 106985
Getting clean layout in forms
Hi;
Is there a url somewhere that explains the best way to use the layout
controls to provide the best layout. I want out windows to still look good
when we add Japanese & German resources - which tend to make the text a lot
shorter / longer.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm Tag: Insert row in datagridview Tag: 106983
Videos
Hi,
i noticed, that there are some really good videos about ASP.NET on
http://asp.net/learn/videos/default.aspx?tabid=63.
Do you know some location, where i can find similar free videos on
windows forms or application programming with .NET?
Greetings
A.Gallus Tag: Insert row in datagridview Tag: 106982
plse provide me links for windows form event details
Hi Grp,
I m newbie. I am looking for basics of Windows Forms. Like ASP.Net page
lifecycle, please give me the links which explains windows form event cycle.
Thanks,
DB Tag: Insert row in datagridview Tag: 106981
Saving info in Registry
Hi,
Under Vista you can't save application settings to HKLM, can anyone point me
in the direction of the new guidlines on where we should store application
data, which is machine wide.
Thanks
Tim Tag: Insert row in datagridview Tag: 106977
Form control re-build when entering the MDI container
We have a huge activex control embedded in a Form window. When the Form
has its MDIParent set to a mdi container, the window handle of the Form
is replaced by a new one, and our control has to be InPlaceActivate
twice plus one InPlaceDeactivate( The window handles of the standard
controls within are also replaced ), This causes side effects to our
activex control. The activation involves lengthy initializations such
as downloading data from internet and heavy rendering work, so it is
too expensive to do InPlaceActivate frequently. And our control has
some operations depending on the parent window. Is there any workaround
to avoid frequent inplace activation and window re-building, for
example, creating the mdi child form directly from the MDI container? Tag: Insert row in datagridview Tag: 106976
DataGridView RowValidation Event
I have a master/detail form that uses a DataGridView to show child
records. I am using the RowValidating event to validate correctly
entered data. As part of the validation process, I set the Cancel
property of the event to true when bad data is present. This works
fine as long as the master binding source remains on the current
record.
If the active master row changes, while a cell in the data grid is in
edit mode, the form freezes. It does not redraw and stops responding
to all events. The grid will still show the pencil in the row header.
This only occurs if a the DataGridView looses focus while a cell is in
edit mode. If no cells were currently being edited when the grid
looses focus everything is fine. Tag: Insert row in datagridview Tag: 106974
Figure out how much text will fit into the form title
I'm assigning a description to my form title, such as:
strDesc = "This is a test if the description will fit in"
frmTest.Text = "(" & strDesc & ")"
If strDesc doesn't fit in the title, I don't see the closing paranthesis:
("This is a test if the description will fi..."
I would like to be able to determine if strDesc will fit into the space
provided, and if it won't fit, I would like display only as much as would fit:
("This is a test if the description will f...)"
How can I do this? Thank you! Tag: Insert row in datagridview Tag: 106969
DataGridView performance
Hi there,
Has anyone had any serious performance problems with this class. A couple of
hundred rows of data with 4 columns (everything loaded on-the-fly with no DB
involved, all simple strings, 90% under 10 characters, the rest as high as
500-600 characters, wrapping turned on) literally takes almost 3 minutes to
load on my 2.4 MHz machine (1 GB RAM with plenty to spare). Wrapping may be
the bottleneck (performance improves when I turn it off) but other than
using virtual mode, can anyone suggest a way to speed things up (or a
reliable 3rd-party control which is really something I wanted to avoid).
Thanks. Tag: Insert row in datagridview Tag: 106963
HTML POST
I have an HTML Form that uses GET and is processed by an ASP.NET 1.1 web
application.
Can you recommend a simple example of an HTML Form that uses POST and is
processed by an ASP.NET web application (either 1.1 or 2.0)?
What was the source of your information?
Thank you.
--
-- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd. Tag: Insert row in datagridview Tag: 106961
Get Form-Objekt inside VS2005 AddIn
How can I get the Form Obect inside the VS AddIn ?
Public Sub Exec(ByVal commandName As String, ByVal executeOption As
vsCommandExecOption, ByRef varIn As Object, ByRef varOut As Object, ByRef
handled As Boolean) Implements IDTCommandTarget.Exec
handled = False
If executeOption = vsCommandExecOption.vsCommandExecOptionDoDefault Then
If commandName = "MyAddin1.Connect.MyAddin1" Then
handled = True
Dim myForm as Form = ????
Exit Sub
End If
End If Tag: Insert row in datagridview Tag: 106960
Radio button databinfding...
Hi,
I have got three radio buttons
o Yes (Db Value= 1)
o No (Db Value= 2)
o Maybe (Db Value= 3)
The data is stored on DB on one field as tinyint. I would like to bind
the data row to windows form. how can I bind that data to the radios? I
think It must not be so diffucult :). But I am better on web forms and
it is much more easy to binding on web pages. Is there something that I
do not aware of?
I do not want to use drop down... :'(
Thanks... Tag: Insert row in datagridview Tag: 106958
drag and drop issue...
If I use software like OpenOffice and try to drag text I could notice that
1. when I drag inside the document I'm moving the text
2. when I drag outside the document I'm copying the text
Yet it all looks like one smooth operation. With correct cursor feedback
(the little + marker next to the icon).
My problem is, once I call DoDragDrop() it's blocking, I have no other
opportunities to change the AllowedEffect to only Copy if I drag over, say,
an other control
And QueryContinueDrag:
1. don't allow me to change the efect
2. don't inform me about the current drop target
How could I do that?
(i.e. how could I modify the allowed efffect depending on the target (i.e.
wether it's me or not)) Tag: Insert row in datagridview Tag: 106955
Tooltip for a Listview - No Delay settings?
I have crafted a routine that allows me to have my tooltip reflect
which Item in my ListView I am hovering over, but I can't implement any
of the delay functions. Has anyone been able to address this? I'm
pretty sure I'm just missing some simple paradigm.
Code:
Elsewhere
{
ToolTip tip = new ToolTip();
}
private void DisabledUserList_MouseMove(object sender, MouseEventArgs
e)
{
Point p = Cursor.Position;
p = DisabledUserList.PointToClient(p);
int CurrentIndex = DisabledUserList.IndexFromPoint(p);
if (CurrentIndex != LastIndex && CurrentIndex > 0)
{
LastIndex = CurrentIndex;
//System.Threading.Thread.Sleep(1000);
tip.ReshowDelay = 5000; // DOES NOTHING
tip.InitialDelay = 2000; //DOES NOTHING
tip.IsBalloon = true;
DataRowView drv =
(DataRowView)(DisabledUserList.Items[CurrentIndex]);
tip.SetToolTip(DisabledUserList,
drv["Path"].ToString());
}
else
{
if (CurrentIndex < 0) tip.SetToolTip(DisabledUserList,
"");
}
}
Thanks for taking a look and helping!
Brian Hampson
System Administrator - North America
ALS Laboratory Group Tag: Insert row in datagridview Tag: 106954
Clipboard Problems with HTML
I'm trying to intercept the clipboard so that I can fix Word's disasterous
HTML that comes through before pasting it into a text box. I just pull the
fragment information from the result that comes back when you ask for the
Text that's of type HTML.
Everything works just great, except when there are accents:
- è - è - ê - ë - à - â - ô - ö - î - ' - ? - ! - ;
If you paste that into word and then paste it into a text box and intercept
the clipboard I get all kinds of weird characters none of which are those
above. If I leave it alone of course it works just fine. It looks like the
Clipboard in .NET is not handling unicode right or something. I'm at a loss.
Anyone have any ideas on how I can get the clipboard of HTML code correctly?
Thanks!
James Hancock Tag: Insert row in datagridview Tag: 106945
tooltip disappears after click on button
Hello, I have a problem using tooltips on buttons...
Before the first click on the button the tooltip displays correctly,
but once the button has been clicked, the tooltip isn't shown any
more...
Is this a bug? Or normal behavior ?
Regards,
Kevin Tag: Insert row in datagridview Tag: 106931
C# windows application
Hi All,
I developed a C# window application (not Web Application as I
need exe file) needs to handle the Proxy Script with URL
Form: 2 text Boxes (one for filling URL, one for filling Proxy
Script string)
One Button: To calculate the time differences between request and
response (i.e. when URL is requested by user
with proxy script
textbox filled)
One Label: To show the calculated time difference.
My Code is given below
private void Calc_Time_For_URL()
{
try
{ //Time of Request
DateTime dt4 = DateTime.Now;
System.Net.HttpWebRequest myReq = (HttpWebRequest)
WebRequest.Create(tbxURL.Text.ToString());
//Proxy Script
if (tbxProxyScript.Text.Length > 0)
{
//I NEED CODE FOR THIS SECTION MEANS HOW TO HANDLE PROXY
SCRIPT WITH URL
}
//GetResponse for this request.
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse();
//Time of Response
DateTime dt5 = DateTime.Now;
lblTimeTaken.Text = Convert.ToString(dt5.Subtract(dt4));
}
catch(System.Exception ex)
{
string message = "Please Enter Url with http://www or https://www as
prefix
as per your need\nError returned is :\n " +
ex.Message;
string caption = "Error!!!";
DialogResult result;
MessageBoxButtons buttons = MessageBoxButtons.OK;
result = MessageBox.Show(message,caption,buttons);
}
}
Does any body have idea, Please mail me ASAP if possible, and this is very
urgent issue.
Thanks,
Deepak
kr_deepak123@skype.com
kr_deepak123@hotmail.com
kr_deepak123@yahoo.co.in
+919886735837 Tag: Insert row in datagridview Tag: 106930
using delegates and updating windows forms
Hi all:
I have been playing around trying to get a progress bar to work. So far, I
have the progress bar updating visibly, but the rest of the dialog now looks
crappy. The rest of the dialog window badly needs a repaint, but it doesn't
get one until the routine finishes that the progress-bar is attached to.
I think part of the problem is that I don't understand the syntax for using
delegates and threads completely. Can any one point me to a web-article on
this topic, or perhaps tell me what I am doing wrong? I thought I had worked
the progress-bar more or less according to the VS2005 docs.
Example code follows
========================
' blah blah.... initial code
Delegate Sub UIDelegate()
Sub updateUI()
Me.ProgressBar1.Increment(1)
End Sub
Private Sub CreateBigCatalog() ' my time consuming routine
' Setup progress bar
Dim newDelegate As New UIDelegate(AddressOf updateUI)
Me.ProgressBar1.Value = 0
Me.ProgressBar1.Maximum = 1000
For Each title As DataRow In MyTitleTable.Rows
ProgressBar1.Invoke(newDelegate)
' ..... blah blah more time consuming code ....
next title
end sub
-----
What should I have done differently?
Thanks in advance and have a great day!
Bill Angus, MA
http://www.psychtest.com Tag: Insert row in datagridview Tag: 106925
AddFontResource - how to update RTB?
I've found the AddFontResource method - - however, any controls, like the
RichTextBox, that are already loaded, don't recognize the new font, once
it's 'added'
How can I 'refresh' the controls, so they can recognize the new Font that
has been added? Tag: Insert row in datagridview Tag: 106923
Method Conversion from VB6 to VB.Net 2005
In vb6, I had a program that had the following code:
StrPtr
LenB
Picture1.Print
Picture1.CurrentX (& Y)
They don't apparently transfer over in vb.net 2005 - - -
I hate to admit it, but I found this code somewhere on line and I have never
used these properties/methods again for anything else and don't know what to
look for in place of them...
Can someone help me find the answers please? Tag: Insert row in datagridview Tag: 106919
MouseLeave fired on childs controls, This does not have thus to be.
Hi;
A UserControl named ContainerInfo has children controls;
ContainerInfo also has the MouseLeave event.
But one goes off when the cursor of the mouse is in a children control .
This does not have thus to be, by a contracted being in ContainerInfo
mouse has not left this.
What I must do?
Regards
Alvaro. Tag: Insert row in datagridview Tag: 106917
Multi-window application example
Hi,
I am porting an application from Windows Mobile to the desktop. This is my
first .NET desktop forms application (my experience is in ASP.NET). I am
looking for a sample application that employs a solid programming model for
managing a multi-window application. This application has a lot of
dynamiccally built forms and opens and closes forms as necessary and can
have multiple forms open at once. Its very simple on Windows Mobile because
all forms are always maximized and you can layer forms on top of each other
with no problem.
Thanks for any assistance.
-Dave Tag: Insert row in datagridview Tag: 106910
Layered architecture
Hi.
It is often maintained, that a layered architecture is something one should
consider in any nontrivial application (see e.g. Data Binding with Windows
Forms by Brian Noyces).
I have a VS2005 solution with 3 projects in it:
1. Adveita.UI - a WinForms executable for user interaction
2. Adveita.BLL - a library project for buisiness logic
3. Adveita.DAL - also a library project, for data access
In order to achieve a full decoupling between the UI and DAL layers, I find
myself writing wrapper classes in the BLL layer to present tables, columns
etc. to the UI layer. Also, I am writing a lot of code to bind controls like
text boxes to data and the like. I think, that the designer should be doing
this for me in most cases and I that I am perhaps doing something basically
wrong here. On the other hand, examples in books and downloadable samples
are rather simplistic and hardly tackle questions like these.
Can anyone comment on this, point out to me samples or articles addressing
these questions.
Regards,
Gudni Tag: Insert row in datagridview Tag: 106908
Not authorised exception using Web Browser control
Guys,
Not sure on the best forum for this.
We are getting an unauthorised exception when using the web browser control
as you can see from the call stack below
TestCase
'Tranmit.Sprinter.WebApp.Testing.Purchasing.Invoicing.Edit.EditInvoiceTest.EditInvoice_3'
failed: System.UnauthorizedAccessException : Access is denied.
at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at mshtml.HTMLAnchorElementClass.click()
at Tranmit.Testing.InternetExplorerSupport.ClickAnchor(HTMLAnchorElement
anchor)
at Tranmit.Testing.InternetExplorerSupport.ClickAnchorByHref(HTMLDocument
document, String anchorHrefRegEx)
c:\assemblies\tranmit.sprinter.webapp.testing\purchasing\invoicing\edit\editinvoicetest.cs(338,0):atTranmit.Sprinter.WebApp.Testing.Purchasing.Invoicing.Edit.EditInvoiceTest.ViewInvoice(ISupplierPayment supplierPayment, InternetExplorerSupportieSupport)The issue is in the HTMLAnchorElementClass click method.How can I diagose this further. I am running the code from the interactiveuser account using Visual Studio .NET 2003 and the NUnit framework. Can Ifind out what security permissions are missing?CheersMatt Tag: Insert row in datagridview Tag: 106906
Custom Form working at runtime but cannot be loaded in designer
Hi,
I have a custom form that works fine when I debug it or run it in release
mode but cannot be loaded in the designer... Actually, it can be loaded in
the designer when no control is on it, but the resizing tool (in the
designer) is offset both horizontally and vertically and when I put a
control on it, as soon as I save, the designer throws an exception (but
cannot be reproduced everytime) and the form cannot be loaded anymore unless
I remove all the controls from it... but the major problem is the offset of
the designer... also, I'm unable to move the newly added controls on my
form... I can resize them when I add them and after that cannot even select
them... this behavior happens when I want to use the custom form (inherit
forms of my projects from this form)...
When I want to see the form in the designer (the CustomForm itself inherited
from system.windows.forms.form) I receive and exception too (here it is)
Events cannot be set on the object passed to the event binding service
because a site associated with the object could not be located.
Hide
at
System.ComponentModel.Design.EventBindingService.EventPropertyDescriptor.SetValue(Object
component, Object value)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAttachEventStatement(IDesignerSerializationManager
manager, CodeAttachEventStatement statement)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager
manager, CodeStatement statement)
Events cannot be set on the object passed to the event binding service
because a site associated with the object could not be located.
Hide
at
System.ComponentModel.Design.EventBindingService.EventPropertyDescriptor.SetValue(Object
component, Object value)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAttachEventStatement(IDesignerSerializationManager
manager, CodeAttachEventStatement statement)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager
manager, CodeStatement statement)
Method 'System.Windows.Forms.Form.SetStyle' not found.
Hide
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags,
Binder binder, Object target, Object[] providedArgs, ParameterModifier[]
modifiers, CultureInfo culture, String[] namedParams)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager
manager, String name, CodeExpression expression)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager
manager, CodeStatement statement)
Does anybody know the solution to this kind of behavior? btw, it may be
relevant to say I'm using a custom message filter (IMessageFilter)
Thanks
ThunderMusic Tag: Insert row in datagridview Tag: 106904
code for proxy script
Hi All,
i m develpoing a .net Window application which has
4 texboxes(tbxURLm for URL in URL Frame,tbxAddress for address in Proxy
server frame,tbxPort for port in proxy server frame,tbxProxyScript for proxy
script in proxy script frame) and a test button..The requirment is given below
STEP BY STEP GUIDE
1. Input the URL you want to test
2. Choose Proxy script/Proxy server with Address and Port Information/No proxy
3. Enter url to proxy script or info for proxy server in respective text box
4. Press test-button
---------------My Code is -------------------------------------------------
private void Calc_Time_For_URL()
{
try
{
//Time of Request
DateTime dt1 = DateTime.Now;
System.Net.HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create
(tbxURL.Text.ToString());
//Proxy Server(Address and Port)
if ((tbxAddress.Text.Length > 0) & (tbxPort.Text.Length >0))
{
myReq.Proxy = new
WebProxy(tbxAddress.Text,Convert.ToInt16(tbxPort.Text));
}
//Proxy Script
if (tbxProxyScript.Text.Length > 0)
{
NEED CODE FOR THIS SECTION
}
//GetResponse for this request.
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse();
//Time of Response
DateTime dt2 = DateTime.Now;
lblTimeTaken.Text = Convert.ToString(dt2.Subtract(dt1));
}
--------------------------------------------------------------------
in this code , i m unable to WRITE THE LOGIC FOR pXOSYSCRIPT, Can anybody
tell me how can i do this thorugh the code....This application is workign
fine for Url alone and Url with address and port but what should be code for
proxyscritp with url ?????????
..
i m working on window application as i need *.exe file rather than install
file ....
Thanks,
Deepak Tag: Insert row in datagridview Tag: 106897
Exception handling, Retry, Resume Next
There are situations where you want to retry/rerun the same code again (if
user wants) for unlimited times for a particular exception thrown. For
example in situations like there's no CD in the drive or some file is locked
by another process you want to display message dialog to user with "Retry"
and "Cancel" buttons (As Windows shows "Retry" option if no CD in drive) and
if user clicks "Retry" you want to run the same code again that thrown the
exception.
How can I construct the same "Retry" exception handling behaviour in C#.
Secondly, how can I construct VB6's "OnError ResumeNext" equivalent in C#
for particular exception handling. "OnError ResumeNext" actually resumes with
next instruction/code if a line/code produces an exception. For example in a
loop if something raised exception I want loop to continue with next
iteration.
How can the VB6's "OnError ResumeNext" constructed in C#.
regards,
Adil Tag: Insert row in datagridview Tag: 106895
theme
Hello,
How can I force my application to use a certain theme without that the user
has to install the theme on his OS?
For Instance I like the new Zune theme, and would like that my app looks
like it.
The end goal is that I would provide multiple themes with my app so that the
user could choose.
And another question, how could I use an image as a background for the forms
of my application, but in a way that you can resize the forms without losing
quality of the backgroiund image.
thanx,
Tom Tag: Insert row in datagridview Tag: 106894
How my application can know that, file is being copied
Hello
I am working on USB Project, I am searching for any of the API's method in windows , so that my application can sense that a file in the PC is being copied or moved onto the USB mass storage device which is plugged-into my system.
I am developing my application in VC++.Net 2005, that is MFC in windows XP. I want this code to work on any windows version of operating system.
If this is not possible for all versions of operating systems of windows. What could be the case in windows XP.
Can anybody help me out for this..
Thank you
Anoo
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com Tag: Insert row in datagridview Tag: 106893
Checking time taken for caaling url using proxy server\proxyscript
Hi All,
i m develpoing a .net Window application which has
4 texboxes(tbxURLmfor URL in URL Frame,tbxAddress for address in Proxy
server frame,tbxPort for port in proxy server frame,tbxProxyScript for proxy
script in proxy script frame) and a test button..The requirment is given below
STEP BY STEP GUIDE
1. Input the URL you want to test
2. Choose Proxy script/Proxy server with Address and Port Information/No proxy
3. Enter url to proxy script or info for proxy server in respective text box
4. Press test-button
---------------My Code is -------------------------------------------------
DateTime dt1 = DateTime.Now;
System.Net.HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(tbxURL.Text.ToString());
//GetResponse for this request.
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse();
DateTime dt2 = DateTime.Now;
lblTimeTaken.Text = Convert.ToString(dt2.Subtract(dt1));
--------------------------------------------------------------------
in this code , i m unable to set the value of proxy script textbox ,if any
or proxy server(Address and port) ,only thing which i do threough this code
is sending the url without any proxyscript ans proxy server(address and port
info) Can anybody tell me how can i do this thorugh the code....
..
i m working on window application as i need *.exe file rather than install
file ....
Thanks,
Deepak Tag: Insert row in datagridview Tag: 106892
Control sizing bug for UserControl hosted in IE7
I have reported this bug on Microsoft Connect but have seen no activity
so I thought I would post here and see if anyone else has been affected
by this.
I have written a UserControl and successfully hosted it in a web page.
When this web page is displayed in IE7 the control gets shrunk to half
size whenever you open additional tabs to display other pages.
I think this happens because the pages are rendered at half size in the
tabbed pages view.
Has anyone else seen this? If so and you want some action, go vote on or
validated my bug report on Microsoft Connect.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=205530
Thanks,
Peter Bromley Tag: Insert row in datagridview Tag: 106891
Automatically Wrap Text in Label
I have the following scenario: I have a TableLayoutPanel in my form. In
one of the cells I want to place a Label control to display some text.
The label might have just a few words. It might have a paragraph. I
would like the label text to automatically wrap inside the cell in the
TableLayoutPanel. If the row in the TLP is not large enough, it should
automatically grow so that it can display all of the text.
1) I have tried setting Dock:Fill and AutoSize:False on the label. This
will cause the text in the label to wrap, but it will not grow past the
size of the cell in the TLP. If I set the row in the TLP to be
AutoSize, the whole row becomes hidden.
2) If I set it to Dock:Top, AutoSize:False, and set the TLP row to
AutoSize, this works, as long as the height of the Label is set to a
value sufficient enough to hold all of the text. But if the height is
not big enough, the text gets cut off.
In case 2 above, it seems like I am on the right track, and that it
would work if I had some way of dynamically making the Label taller
depending on whether it still needed to wrap the text.
Any suggestions for me on how I can accomplish this? Tag: Insert row in datagridview Tag: 106890
Dynamically view fonts not installed
Let's say I have a document loaded in a RichTextBox - I want to see how it
looks with a certain font, however, the font is not loaded (in another
directory)
Is there a way, with VB.Net, to view text in an application (set the
RichTextBox's Font), with a non-installed font? Tag: Insert row in datagridview Tag: 106884
Detecting Keyboard keys
I can use Asc(e.KeyChar) to find out the keystrokes in the regular part of
the keyboard.
Is there any way to detect ASC value of either the F keys or the arrow keys? Tag: Insert row in datagridview Tag: 106882
VISTA \ MSCorLib \ Requested registry acces is not allowed
Can someone confirm that it is now impossible to write to
registry\localmachine on Windows Vista using .NET FX 2.0 + .NET FX 3.0
Can't the developer put application into "Administrator" mode for the user. Tag: Insert row in datagridview Tag: 106880
Switching localizable forms language messes up design
I have a C# windows forms project that was designed in Visual Studio
2003. It works great. I have recently decided to upgrade to VS 2005
and .Net 2.0. I opened the project in VS 2005 and it converted it
fine. I fixed the odd obsolete line of code and it compiles and runs.
The problem is that my previous design was done with the systems
display set to Large Fonts. My new dev system is set to Samll Fonts
because this is the default setting in windows. These means I have had
to go into each form and modify it slightly but that is fine.
Now, my program is setup to be localizable between english(default) and
french. Whenever I need to make a change to a french version of a form
I just change the language in the form properties to french and boom,
there it is. Now this worked perfectly in VS 2003 but in VS 2005 when
I try to change the language back to english(default) after making a
mod to the french version, my whole form gets screwed up. The
background colour of the form and almost all of the text box properties
get reset to the windows default settings. The biggest problem about
this is that it is a big form with over a hundred labels and text boxes
so to have to change it back all of the time can be very time
consuming.
I have tried everything imaginable to get it to stop doing this. I
even removed the french resx file, and switched my form to not
localizable, then I switch it back and re-create the french resx file,
and whenever I go back to english, it is all messed up.
Does anyone have a clue as to what is wrong? Unfortunately I cannot
post the code for the form as it is secret in nature.
Thanks in advance,
Scott Tag: Insert row in datagridview Tag: 106879
How to know if the "Active" application changes?
Hi All.
Is there any way to be notified when the "Active" application
changes? By active I mean which application currently has
mouse and keyboard focus.
I need to be able to know when my application becomes active
and when it becomes non-active. (i.e.: via minimization, or
alt-tab, etc)
Any ideas? Tag: Insert row in datagridview Tag: 106877
MDI windows list not updating
I have an MDI form and multiple MDI Children. I used MdiWindowListItem to
display the list of my MDI Children in my MDI's Windows menu. If I change the
Text property of a Child window (Form's caption) the menu that shows the list
of the Childern doesn't update ; it shows the old title. I tried to set the
Child's MDIParent property to null and then back to my MDI form but it's time
consuming and it's flickering. Any (other) ideas?
Thanks allot.
CableGuy Tag: Insert row in datagridview Tag: 106876
Zorder and splash screen
Hi,
I have a form which is a splash screen. A static method is used by my
main program startup to show the form, which creates the form on a
seperate thread and shows it using Application.Run( splash ).
The problem is when my main form shows and the splash hides, the main
form ends up behind any other window display (such as my web browser or
explorer windows).
I've read this is because the first message pump that ends causes the
application to deactivate, but I haven't been able to find a solution
to this.
I had replaced Application.Run with this loop:
while ( !shouldClose ) {
Application.DoEvents();
}
Where should close is a boolean that indicates if the form should close
or not. (Which is set by another static method called from the main
thread).
Any ideas? Tag: Insert row in datagridview Tag: 106874
"Attempted to read or write protected memory" since 10 days...
Hi,
Since 10 days (the first time was the 10th of november) I have some weird
exception happening in an application here:
All (except 1 of the total of 5) users had this error now 1 of 2 times
during the last 10 days. It happens mostly during startup or closing of the
application, but sometimes just in the middle of nowhere. It doesn't point
to anyting special. I don't get a clue...
It's a Windows Forms VB.NET 2005 application. I roll out updates regulary
(once a week), but nothing special has changed in the last update before the
first error.
Does anybody has any idea why this happens?
Thansk a lot in advance, any help will be really appreciated,
Pieter
This is the full exception:
Exception Source: System
Exception Type: System.AccessViolationException
Exception Message: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt.
Exception Target Site: WSAGetOverlappedResult
---- Stack Trace ----
System.Net.OSSOCK.WSAGetOverlappedResult(socketHandle As SafeCloseSocket,
overlapped As IntPtr, bytesTransferred As UInt32&, wait As Boolean, ignored
As IntPtr)
Ghost.exe: N 00000
System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(errorCode
As UInt32, numBytes As UInt32, nativeOverlapped As NativeOverlapped*)
Ghost.exe: N 00177
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(errorCode
As UInt32, numBytes As UInt32, pOVERLAP As NativeOverlapped*)
Ghost.exe: N 00103 Tag: Insert row in datagridview Tag: 106864
Serializing Controls in .NET 2.0
How come it's no more possible to serialize winforms controls?
(As I recall, it was possible in the 1.1 version of the .NET framework)
Is there a solution to this problem?
Thanks! Tag: Insert row in datagridview Tag: 106863
How to set font from PrivateFontCollention as default font for a f
Hi all,
I have a font loaded in a PrivateFontColeccion and want to apply it to every
control and form that compose my app.
I don't want to have to apply it one control by one so I was wondering if
there is a way to make my PrivateFontCollection as the primary or default
font container so when the app runs the fonts specified as properties in my
form controls are searched in my PrivateFontCollection before in the system
installed fonts.
Any ideas?
Thanks! Tag: Insert row in datagridview Tag: 106860
PowerPoint Automation
I am using PowerPoint Automation with late binding i.e i m using
CreateObject("PowerPoint.Application"). But im unable to register Events Of
powerpoint with LateBinding. if i try to register any eventhandler with
object i get compile time error.
Is there any way to use Events of powerpoint in late binding case. Tag: Insert row in datagridview Tag: 106858
Making *.exe file
i need to develop a tool (an exe-file, not an install) that we can use to
test the time for different calls, using Proxy or not so i m creating C#
Window Application for this.
What the tool should look like and do:
URL (text box) - Let user specify URL to test. Can be both http or https.
Proxy (text boxes) - Let user specify Proxy script or Proxy server (Address,
Port) or No proxy at all (empty)
Test (command button) - Execute test that calculates time for call. Triggers
timer and call of URL.
Time (label) - Specify time that the test took.........
Can AnyBody help me through the code......
Thanks,
Deepak Tag: Insert row in datagridview Tag: 106856
Vista + HKLM Write
Hi,
One of my HKLM registry writes is throwing fit on Vista. Is there anything
I can do on programming level to prevent the error.
Or is this a user setting that has to be configured. Tag: Insert row in datagridview Tag: 106853
Help with double-click and drag-drop
Hi: I posted this 3 days ago in another V-Studio2005 group and got no
replies. There seems to be better response to requests in this group. Hope
nobody minds me trying for an answer here.
I have windows forms .Net 2 app. in which I was using double click to
activate a form. I also wanted to be able to drag items out of one form onto
another. I got both working separately, but I can't seem to get them to work
together. The mousedown event is trapped by my drag-drop routine. This
prevents double-click. As soon as mousedown fires, the app thinks it is
dragging out. The datagridview control will not accept to have both
double-=click and drag-drop both as possible user-actions.
Any help or ideas will be greatly appreciated.
Thanks and have a great day!
Bill Angus, MA
http://www.psychtest.com Tag: Insert row in datagridview Tag: 106850
hello,
can i make to insert one row between 2 existing rows.