|
You can get a stream to an embedded resource, so you coulds use them for sounds or images etc.
And anyway, whats wrong with having the dll's outside the app?
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
Currently, this code will return immediately after the process is
started. How can I modify it so that it will not return until the
process has stopped?
using (Process process = new Process())
{
process.StartInfo.FileName = @"C:\myprocess.exe";
process.StartInfo.Arguments = String.Format("-j {0}",
path);
process.Start();
}
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote: Currently, this code will return immediately after the process is
started. How can I modify it so that it will not return until the
process has stopped?
process.Start();
process.WaitForExit(); Share and enjoy.
Sean
|
|
|
|
|
Hi,
Am trying to create a custom DataGrid control the only pursues of this controls is to disable the HTML tags to be drawn in grid cells.
Am using VS.Net 2003 / C#
This is the controls class
<br />
using System;<br />
using System.Data;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.ComponentModel;<br />
using System.IO;<br />
<br />
namespace MyControl<br />
{<br />
[DefaultProperty("Text"), ToolboxData("<{0}:CustomDataGrid runat=server></{0}:CustomDataGrid>")]<br />
public class CustomDataGrid: DataGrid<br />
{<br />
<br />
public CustomDataGrid()<br />
{<br />
base.CopyBaseAttributes( this ); <br />
}<br />
<br />
<br />
protected override void OnItemDataBound(DataGridItemEventArgs e)<br />
{<br />
foreach( TableCell tblCell in e.Item.Cells)<br />
{<br />
tblCell.Text = tblCell.Text.Replace(">", ">").Replace("<", "<");<br />
}<br />
<br />
base.OnItemDataBound (e);<br />
}<br />
<br />
}<br />
}<br />
This is the HTML representation on the control on my ASPX Page
<br />
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="AspTest.WebForm1" %><br />
<%@ Register TagPrefix="cc1" Namespace="MyControl" Assembly=" MyControl" %><br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><br />
<HTML><br />
<HEAD><br />
<title>WebForm1</title><br />
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"><br />
<meta name="CODE_LANGUAGE" Content="C#"><br />
<meta name="vs_defaultClientScript" content="JavaScript"><br />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"><br />
</HEAD><br />
<body><br />
<form id="Form1" method="post" runat="server"><br />
<cc1:CustomDataGrid id="CustomDataGrid1" runat="server" AllowHightLight="True" CssClass="TableStyle"<br />
GridLines="Vertical" AutoGenerateColumns="False"><br />
<FooterStyle Font-Size="0pt" ForeColor="White"></FooterStyle><br />
<AlternatingItemStyle CssClass="TableEvenStyle"></AlternatingItemStyle><br />
<ItemStyle CssClass="TableOddStyle"></ItemStyle><br />
<HeaderStyle CssClass="TableHeader"></HeaderStyle><br />
<Columns><br />
<asp:TemplateColumn HeaderText="dc"><br />
<ItemTemplate><br />
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.dc") %>' ID="Label1" NAME="Label1"><br />
</asp:Label><br />
</ItemTemplate><br />
</asp:TemplateColumn><br />
<asp:TemplateColumn HeaderText="dc1"><br />
<ItemTemplate><br />
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.dc1") %>' ID="Label2" NAME="Label2"><br />
</asp:Label><br />
</ItemTemplate><br />
</asp:TemplateColumn><br />
</Columns><br />
</cc1:CustomDataGrid><br />
</form><br />
</body><br />
</HTML><br />
The Code Behind
<br />
if (!IsPostBack )<br />
{<br />
CustomDataGrid1.DataSource = dtGetDataSoruce();<br />
CustomDataGrid1.DataBind();<br />
}<br />
<br />
private DataTable dtGetDataSoruce()<br />
{<br />
DataTable dt = new DataTable();<br />
<br />
DataColumn dc = new DataColumn("dc");<br />
DataColumn dc1 = new DataColumn("dc1");<br />
<br />
<br />
dt.Columns.Add(dc);<br />
dt.Columns.Add(dc1);<br />
<br />
DataRow dr = dt.NewRow();<br />
DataRow dr1 = dt.NewRow();<br />
DataRow dr2 = dt.NewRow();<br />
DataRow dr3 = dt.NewRow();<br />
<br />
dr["dc"] = "1";<br />
dr["dc1"] = "<a href='http://www.yahoo.com'>http://www.CodeProject.com</a>";<br />
<br />
dr1["dc"] = "2";<br />
dr1["dc1"] = "<input type='radio' runat='server' id='this.id' name='g'>";<br />
<br />
dr2["dc"] = "3";<br />
dr2["dc1"] = "Row Number 3";<br />
<br />
dr3["dc"] = "4";<br />
dr3["dc1"] = "Rows Number 4";<br />
<br />
dt.Rows.Add(dr);<br />
dt.Rows.Add(dr1);<br />
dt.Rows.Add(dr2);<br />
dt.Rows.Add(dr3);<br />
<br />
return dt;<br />
<br />
}<br />
<br />
You will note that the bound columns are a templates columns, the project is working properly in case of the grid columns is bound columns, but it’s not working in case of templates columns.
The second issue in the HTML design mode this error will apper
The active schema dose not support the element 'FooterStyle'
And 'asp:TemplateColumn'
And 'HeaderStyle'
And 'asp:TemplateColumn'
Etc. .
Why is the error for and why the controls dose not accepts template columns
Thanks in advance
Ala Qunaibi
|
|
|
|
|
Your ASPX page code doesn't look right. Have you posted it correctly?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="AspTest.WebForm1" %>
<%@ Register TagPrefix="cc1" Namespace="MyControl" Assembly="MyControl" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="Style.css" type="text/css" rel="stylesheet">
<script language="javascript" src="JS/JScript1.js" type="text/javascript"></script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P><cc1:customdatagrid id="CustomDataGrid1" runat="server" AllowHightLight="True" CssClass="TableStyle"
GridLines="Vertical" AutoGenerateColumns="False">
<FooterStyle Font-Size="0pt" ForeColor="White"></FooterStyle>
<AlternatingItemStyle CssClass="TableEvenStyle"></AlternatingItemStyle>
<ItemStyle CssClass="TableOddStyle"></ItemStyle>
<HeaderStyle CssClass="TableHeader"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="dc">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.dc") %>' ID="Label1" NAME="Label1">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="dc1">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.dc1") %>' ID="Label2" NAME="Label2">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</cc1:customdatagrid></P>
</form>
</body>
</HTML>
|
|
|
|
|
Help
I want create an application that can't kill it from taskmanager or cmd?
I Want Learn
|
|
|
|
|
Learn Searcher wrote: I want create an application that can't kill it from taskmanager or cmd?
Why would you want to do that? Anyway, I doubt that it is possible.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Learn Searcher wrote: I want create an application that can't kill it from taskmanager or cmd?
Without it being part of the OS, then there's no way to make an application unkillable. It might be unkillable from the user level you're at, but it will be killable at some level.
Why would you want to do this anyway?
|
|
|
|
|
i hear that when OS want terminate an application send a kill signal to it.
now if handle this signal in our app then can restart our application in termination time of old application time.
And now HOW TO HANDLE THIS SIGNAL ?
I Want Learn
|
|
|
|
|
As far as I know... Windows will politely ask the application to close, and perhaps you can ignore that request, but if the application doesn't doesn't close in response to the request, then Windows will attempt to kill the process, and there is no way to stop that.
As for how to ignore the request, you can probably handle that in the FormClosing event handler.
|
|
|
|
|
hi.
I have a maskedTextBox which is going to accept date from user.
it's format is (00/00/0000) or (Short Date)
and i am using system.datetime.parse() to validate it.
by defult it accepts (mm/dd/yyyy)
how can I change it to (dd/mm/yyyy)?
Regards
|
|
|
|
|
Use:
DateTime result = DateTime.ParseExact(inputDateTimeAsString, "dd/MM/yyyy",
System.Globalization.CultureInfo.CurrentCultureInfo);
Hope this helps!
-Jeff
|
|
|
|
|
Hi there,
i want to set opacity of picturebox like form,
i know its a very common question, and i searched on lots of sites but didnt find any good answer
can some tell how or any article about it?
thanks
Becoming Programmer...
|
|
|
|
|
I don't think you can, I think you need to draw the image yourself and use the ImageAttributes class to set the opacity.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
HI
I'm using propertygrid to display my class properties in it. My code is just Like:
public partial class AddressType
{
.......
.......
}
public partial class Person {
private AddressType homeAddressField;
public AddressType HomeAddress
{
get {
return this.homeAddressField;
}
set {
this.homeAddressField = value;
}
}
}
PropertyGrid just shows the Person Having field HomeAddress. But I can't expand HomeAddress to see AddressType (which is also a class and have actual address properties).
I used ExpandableObjectConverter just like:
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public partial class AddressType
{
.......
.......
}
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public partial class Person {
private AddressType homeAddressField;
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public AddressType HomeAddress
{
get {
return this.homeAddressField;
}
set {
this.homeAddressField = value;
}
}
}
still It has no change......
Please help me how can I tell propertygrid to expand when one class contains another class object.
Tanveer Rashid
|
|
|
|
|
Hey this is my first post in this forum i wish if you can help me
i have downloaded 2 C# application from API forum but the point that i need to put this 2 software together to be as one program that have all the features of each one
in other words
i have 2 programs one of them has MDI features and the other on has many filters i want to add the MDI one to the filters or the opposite in order to use the features of both (MDI and filters)
in one program only to be able to use all the features of Each program within one program
thank alot
http://www.zshare.net/download/530787161f225e/[^]
the total size of the file is 100 Kbyte
-- modified at 21:16 Saturday 1st December, 2007
|
|
|
|
|
Your question is far too vague. Is there something specific you need help with?
/ravi
|
|
|
|
|
ok I modified the problem’s narrative
|
|
|
|
|
Huh? Please rephrase your question a bit better. Makes no sense.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
ok i have 2 programs one of them has MDI features and the other on has many filters i want to add the MDI one to the filters or the opposite in order to use the features of both (MDI and filters)
in one program only to be able to use all the features of Each program within one program
i hope that make a sense
|
|
|
|
|
mymo_h wrote: i hope that make a sense
Yes, it does.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Compile them both as a dlls, then build an application that loads those 2 dlls. If you need help with these steps, ask specific questions as possible.
|
|
|
|
|
Hello everyone,
I have an array which holds ASCII codes. How can I convert this to characters that I read?!
Thank you very much and have a great weekend.
Khoramdin
|
|
|
|
|
Just cast the value as a char:
char letter = array[0];
You can set a char using a letter 'a' , an int 52 , or a hex value 0x00
Of course you'll want some kind of loop to do that, and use an array of chars. Infact, there may be something in the string class, i'll go look now.
-- modified at 18:47 Saturday 1st December, 2007
Aha, i knew that encoder class was somewhere:
string myText = System.Text.ASCIIEncoding.ASCII.GetString(array);
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|