|
yes i use it but it does not work
|
|
|
|
|
With controls unless you're deriving your own you should not manually dispose resources. If you read the documentation for the Form.ShowDialog method, you should notice that you do need to dispose the form in order to dispose of its message pump. An easy way - even in case of an exception - use the using block statement:
using (MyForm form = new MyForm())
{
form.ShowDialog();
} If you don't dispose your object - which will dispose all its child objects that it knows about - when you use a modal dialog (using ShwDialog ), the unmanaged memory will not be released (which is why it's called unmanaged resources).
If you're having problems with threads, make sure that you're only updating controls (like setting the Text property or adding a ListViewItem to a ListView ) on the thread on which the control was created. See the InvokeRequired property and the Invoke method documentation in the .NET Framework SDK for more information and examples aobut how to use them.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi all,
I would like to program the following in Internet Explorer
by C# : add a menu item in the context menu when right click a selected text section in IE and perform some action when the menu item is selected. And how about the similar stuff for right clicking the image in IE ?
Is it related to the shell programming also ?
|
|
|
|
|
I answered a very similar question just the other day. You should make it a habbit of searching first. To search the forums on this site, you click "Search comments" at the top of the message board on each forum (which also lets you search additional forums at the same time).
Take a look at http://www.codeproject.com/script/comments/forums.asp?msg=943726&forumid=1649#xx943726xx[^], which includes other links to MSDN for more information.
As I mention in that thread, I recommend you don't use managed code for this as it adds a lot of overhead to the iexplore.exe (or whatever process hosts the WebBrowser control) in terms of memory and other system resources.
There's also articles here on CodeProject about writing WebBrowser extensions, both in unmanaged and managed code. Enter your search in the text box directly below the logo at the top of each page.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi all,
Is SyncML a current hot topic for development on mobile phone
or pocket pc ?
Is it a good tool for synchronization between pocket pc an desktop ?
thanks
Patrick
|
|
|
|
|
If you have questions about specific products you should first ask the authors of that product. See http://www.syncml.com[^], which has a link at the top of the page, Contact OMA[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I would like to use DPAPI - Data Protection Application Programming Interface to write a Pocket PC application. But does .NET CF have DPAPI?
If not (so unlucky), what can I use?
Thx
|
|
|
|
|
The .NET Framework doesn't encapsulate DPAPI at all. You have to P/Invoke the necessary calls yourself. Read How To Create a DPAPI Library[^].
The Data Protection APIs are supported under Windows CE .NET 4.2 (PocketPC 2003). Windows CE 3.0 does not the DPAPI APIs documented and probably doesn't support it.
Even on PocketPC 2003 (which is actually named "Windows Mobile for PocketPC 2003") you may run into problems because not all of the System.Runtime.InteropServices namespace members are supported. Be sure to view the supported platforms while reading through the System.Runtime.InteropServices documentation in the .NET Framework SDK.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I need to print in Windows98 using Star printer - SP200, which is not capable of graphical printing (can't use DrawString()).
I've tried the code in
<www.c-sharpcorner.com code="" 2002="" oct="" printdirect.aspect.asp="">
changed the left margin (the paper width is 3 inches only) and the ip of printer to be the default printer name using <printersettings.printername> (not shared)
the result is the handle lhPrinter=0 and no response from the printer; nothing is written (pcWritten = 0) although the result of OpenPrinter is not 0.
I appreciate your help...
Sirwan
|
|
|
|
|
|
Hi Stefan,
Thanks for the help.
It looks very important article, but unfortunately I don't understand the language.
Is there any solution can be found in English please?
Thanx
Sirwan
|
|
|
|
|
Hi,
I want to print a report. The height of the report is dynamic.
When I print the report, after the end job, printer eject the last page more than I need. LQ300 eject paper as long az A4 size.
for example: I want to print one line, then the printer stop printing. If I need the paper I self cut it & use it.
I use a roll of paper, no A4 or A3.
I am using c#.
what must I do?
Thanks & Best regards
|
|
|
|
|
hiiii every body can any body help me with this problem
i am using a memory profiler to enhance my code
i discover that an object from (OleDBPermission) is creadted and not removed(disposed) even when i close the connection and Call ReleaseObjectPool what can i do else to release this object please help me
|
|
|
|
|
Permission objects are used by the Framework to protect users and machines and may be instantiated to authorize certain operations. Depending on how certain permissions objects are used, they may remain ni memory until the AppDomain is shutdown.
You should read about Code Access Security - an integral part of the .NET Framework - on MSDN. Read Code Access Security[^] in the .NET Framework SDK.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
|
Hi!Dear,
I just want to register in the website
www.c-sharpcorner.com. but after I filled in my email address and my nickname,it never sent password to my email box.I am my email address is correct.my email address is:libingmomer@163.com,passward is "libing". I dont know where is the problem.Maybe it treat my email address as a invalid one.
Now I prefer my honoured you can register a nickname and a password on this website for me to login.
Thanks!
|
|
|
|
|
What ever that is you are smoking I suggest you stop.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Hi!Colin Angus Mackay,
Maybe you are wrong.What I said is the truth.I had asked one of my friends to help me out of this matter.Maybe I have done something wrong here,but I was never intent to that.
Thanks!
momer
|
|
|
|
|
This is brilliant. It's definately made my day.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi!Christian,
Nice to know you here.I think you must be a warmhearted person.But thanks to my friend,my problem have been worked out yesterday.
The codeproject is the most kindly one in all the website I have ever known.I love this codeproject and I love you!
momer
|
|
|
|
|
1. Why are you posting registration problems to another site here? Why not try to contact the owner of the site your having problems with?
2. Nice of you to post your account name and password for us to use! Like Colin asked... What the hell are you smoking?!
momer wrote:
I dont know where is the problem.
A short between the keyboard and ground, obviously...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do I setup a dropdownlist for (***Type***) in editmode. Any starters. Any sites.
I would appreciate any help.
<itemtemplate>
This dropdownlist works in browse | ***Type:**** | <asp:dropdownlist autopostback="True" id="ddlCOMMANDTYPE" datasource="<%# BindTBCOMMANDTYPE() %>"
mode.="" selectedindex="<%# GetSelectedIndexCOMMANDTYPE(DataBinder.Eval(Container.DataItem, "CT_REF").ToString())%>" runat="server"
="" datatextfield="CT_DESCRIPTION" datavaluefield="CT_REF"> | Content: | <%# Convert.ToString(DataBinder.Eval(Container.DataItem, "CM_CONTENT"))%> |
<asp:linkbutton id="EditButton" text="Edit" commandname="Edit" runat="server">
<edititemtemplate>
| ***Type:**** | Content: | <asp:textbox id="CM_CONTENTTextBox" text="<%# DataBinder.Eval(Container.DataItem, "CM_CONTENT") %>" runat="server"> |
<asp:linkbutton id="UpdateButton" text="Update" commandname="Update" runat="server">
<asp:linkbutton id="DeleteButton" text="Delete" commandname="Delete" runat="server">
<asp:linkbutton id="CancelButton" text="Cancel" commandname="Cancel" runat="server">
<asp:linkbutton id="Prev" text="<< Previous" onclick="Page_DataList" runat="server">
<asp:linkbutton id="Next" text="Next >>" onclick="Page_DataList" runat="server">
////////////////////////////////////////////////////////////////
public int GetSelectedIndexCOMMANDTYPE (string CT_REF)
{
int iLoop;
DataTable dt = ddlDataSet1.Tables["ddlCOMMANDTYPE"];
for (iLoop=0; iLoop < dt.Rows.Count; iLoop++)
{
string srow = dt.Rows[iLoop]["CT_REF"].ToString();
if(srow == CT_REF)
{
return iLoop;
}
};
return 0;
}
//////////////////////////////////////////////////////////////////
public DataSet BindTBCOMMANDTYPE()
{
OdbcConnection myConnection = new OdbcConnection("DSN=POS;UID=system;PWD=system");
// Populate the ddlDataSet1
myConnection.Open();
const string strSQLDDL = @"SELECT CT_REF, CT_DESCRIPTION FROM TBCOMMANDTYPE ORDER BY CT_REF";
OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
ddlDataSet1.Clear();
myDataAdapter.Fill(ddlDataSet1, "ddlCOMMANDTYPE");
myDataAdapter.Dispose();
myDataAdapter = null;
myConnection.Close();
return ddlDataSet1;
}
//***********************************************************************
|
|
|
|
|
Your question belongs in the ASP.NET forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I've put together a component that, upon a certain action, a window opens. I am opening that window directly below the component, aligned with the bottom edge. It works great and exactly as I need it to...until the UC form is contained within a mdicontainer.
I am currently determining the position to place the window by looking at the position of the current component and its parents. Apparently with mdicontainers, the child form is a parent and I cannot get the appropriate screen position because the application form creates an unknown offset.
private void GetRefLocation(Control controlIn, ref int top, ref int left)<br />
{<br />
<br />
Control controlParent = controlIn.Parent;<br />
Form parent = this.FindForm();<br />
<br />
if (parent == controlParent)<br />
{<br />
top += parent.Top;<br />
left += parent.Left;<br />
}<br />
else<br />
{<br />
int addHeight = 0;<br />
System.Type a = controlParent.GetType();<br />
string b = controlParent.GetType().FullName;<br />
if (controlParent.GetType().FullName == "System.Windows.Forms.Panel")<br />
addHeight = ((Panel)controlParent).BorderStyle == BorderStyle.None ? 0 : (((Panel)controlParent).BorderStyle == BorderStyle.FixedSingle ? 1 : 2);<br />
<br />
top += controlParent.Top + addHeight;<br />
left += controlParent.Left;<br />
GetRefLocation(controlParent, ref top, ref left);<br />
}<br />
}
What do I really need to do to determine the position within the screen? I followed a couple trails involving GDI but I never found a way that I can set component.Location based on the screen position, let alone position of another component.
Thanks
|
|
|
|
|
dbetting wrote:
What do I really need to do to determine the position within the screen?
Use the PointToScreen and PointToClient methods of Control class to convert a location from client coordinates to screen coordinates respectively the other way round.
www.troschuetz.de
|
|
|
|