|
hi Oskars!
you can put you custom control on a floating window. this window will be on top of all window, just like the list of the combobox.
try to look at this[^] to have an idea how to make a floating window.
hope that helps!
microsoc
|
|
|
|
|
Hello,
I am trying to convert this following PHP code to C# for Windows Application, (Not ASP.NET). My intention is to post file attachment to remote server by doing this. I know how to convert base64 in C#, but I dont know which Method of C# do this chunk_split. Can anyone please help !
string chunk_split ( string body [, int chunklen [, string end]] )
This functoin can be used to split a string into smaller chunks which is useful for e.g. converting base64_encode() output to match RFC 2045 semantics. It inserts end (defaults to "\r\n") every chunklen characters (defaults to 76). It returns the new string leaving the original string untouched.
|
|
|
|
|
emran834 wrote: string chunk_split ( string body [, int chunklen [, string end]] )
This functoin can be used to split a string into smaller chunks which is useful for e.g. converting base64_encode() output to match RFC 2045 semantics. It inserts end (defaults to "\r\n") every chunklen characters (defaults to 76). It returns the new string leaving the original string untouched.
What is the problem? From the description its pretty clear what it does, so just implement the same in C#. One way is to use a StringBuilder and inject '\r\n' at every 76 char interval.
|
|
|
|
|
Hi,
thanks for your reply. As I am new in C#, would you please show me the snippet for doing this. !!
Thanks and regards
Emran
|
|
|
|
|
|
I have a windows form application. When the user clicks the pause button, I want to programmatically minimize the window. Does anyone have the snippet for doing this in the 2.0 Framework?
Thanks
|
|
|
|
|
|
Thanks leppie, but I cannot find WindowState in either my instance form or the static Form methods. The closest thing I can find is form.ReflectMessage, but I don't know exactly what the hWnd message would be to do a minimize.
|
|
|
|
|
System.Windows.Forms.Form.WindowState : FormWindowState straight from Reflector.NET
|
|
|
|
|
leppie, I don't doubt you, but in C# Express the Intellisense Forms.Form stops at ReferenceEquals and does not show WindowState at all.
|
|
|
|
|
Its an instance property Unless C# Express is broken or it has changed in .NET 2, it has to be there!
|
|
|
|
|
I'm not finding it in the instance object either. It is .NE 2 but it is also C# Express which at least limits some of the functionality of the framework. Though I cannot see why they would hide the WindowState property.
|
|
|
|
|
<FONT color=Blue>namespace</FONT> WindowsApplication1
{
<FONT color=Blue>public partial class</FONT> Form1 : Form
{
<FONT color=Blue>public</FONT> Form1<FONT color=DarkBlue>()</FONT>
{
InitializeComponent<FONT color=DarkBlue>()</FONT>;
<FONT color=Blue>this</FONT><FONT color=DarkBlue>.</FONT>WindowState = FormWindowState<FONT color=DarkBlue>.</FONT>Minimized;
}
}
}
|
|
|
|
|
Whew, that did it. Never thought to go into the form code and type this.
Thanks leppie.
|
|
|
|
|
Hi
I am programming in c#.net. I want to insert i record into the SQL Server database. the datetime format in SQL server is mm/dd/yyyy where as in c# its dd/mm/yyyy. therefore when i try to insert dates where the day value is greater then 12 it gives out of range error.
Is there anyway we can change the format (dd/mm/yyyy to mm/dd/yyyy) of the datetime as we insert it into the sql server database.
Deepak Anish
Computer Programmer
Maxumise Fiji Ltd
Suva, Fiji
|
|
|
|
|
Use parameterizes queries, then the date format is not a problem.
If you need to format the date as a string, I suggest that you use the ISO 8601 date format, e.g. yyyy-mm-dd. It's an unambigous date format, so the database can not misinterpret it.
---
b { font-weight: normal; }
|
|
|
|
|
I think you can pass the format via the ToString method.
If all else fails: see my
Article[^]
It's not the best according to readers, but it works .
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
hi
i draw a rectangle in picterebox and i want to rotate it around it's center and i want enable doublebuffering for prevent flicker and get highest quality
for my animation but it doesn't work
the ather problem is when i call g.Dispose(); in timer1_Tick event my app is crash .where does my problem and how to animate my rectangle with
doublebuffering and highest quality without flicker my animation ???
my code here :
Graphics g;
Pen m_pen;
Matrix mat;
int angle;
bool _doBuffer;
public Form1()
{
InitializeComponent();
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer ,true);
this.UpdateStyles();
m_pen = new Pen(Color.Violet,3);
bm = new Bitmap(src);
mat = new Matrix();
angle = 1;
_doBuffer = true;
}
private void button1_Click(object sender, System.EventArgs e)
{
g = pictureBox1.CreateGraphics();
g.DrawImage(bm,20,20,100,100);
timer1.Enabled = true;
timer1.Start();
Invalidate();
}
private Bitmap _backBuffer;
private void timer1_Tick(object sender, System.EventArgs e)
{
if(_backBuffer==null)
{
_backBuffer=new Bitmap(pictureBox1.ClientSize.Width,this.ClientSize.Height);
}
Graphics g=null;
if(_doBuffer)
g=Graphics.FromImage(_backBuffer);
else
g=pictureBox1.CreateGraphics();
g.Clear(Color.White);
g.SmoothingMode = SmoothingMode.AntiAlias;
p = new Point(70,70);
mat.RotateAt(angle,p);
g.Transform = mat;
g.DrawImage(bm,10,10,100,100);
//g.Dispose();
g.DrawImageUnscaled(_backBuffer,10,10,100,100);
Invalidate();
}
|
|
|
|
|
hdv212 wrote: g = pictureBox1.CreateGraphics();
You approach is wrong. Only handle painting in the OnPaint event, you can however do the rest where you have them now.
-- modified at 1:16 Friday 31st March, 2006
|
|
|
|
|
Hi,
Can someone show me how to put together a C# method to read the time of a remote PC, please. Thanks so much.
.NET Beginner
|
|
|
|
|
An easy way to get a remote PC's current time would be to use the "NET TIME" console command. This will only work if your PC and the Remote PC are at least NT4. Also, this isn't the greatest method if you need to parse out the date time from the console output.
System.Diagnostics.Process proc = new System.Diagnostics.Process();<br />
proc.StartInfo.UseShellExecute = false;<br />
proc.StartInfo.CreateNoWindow = true;<br />
proc.StartInfo.RedirectStandardOutput = true;<br />
proc.StartInfo.FileName = "net";<br />
proc.StartInfo.Arguments = "time \\\\MyRemotePC";<br />
proc.Start();<br />
MessageBox.Show(proc.StandardOutput.ReadToEnd());<br />
proc.WaitForExit();<br />
proc.Dispose();
-- modified at 20:35 Thursday 30th March, 2006
|
|
|
|
|
Hi Joshua,
Thanks for your help. I tried it and it worked. Is there a way to get the time with miliseconds also because I will also need the miliseconds?
.NET Beginner
|
|
|
|
|
I'm sorry. I don't know how to get the milliseconds.
|
|
|
|
|
If you're allowed to install your own app onto the remote PC, then you could use .NET Remoting (via TCP/IP) to get the date time in any format that you want. It would take a lot more doing on your part, but it would be the most powerful because you could provide all the info that your client app needs.
|
|
|
|
|
as a part of my project i hv to design a text editor i want to know how to make the normal options like cut , copy and paste
and above all how to print the document and see it in the print preview
thank u
abdelhameed81
|
|
|
|