|
Nnamdi Onyeyiri wrote:
Besides, i had more important things to do yesterday.
More important things to do than programming!?!?! You've lost your mind!
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
David Stone wrote:
More important things to do than programming!?!?! You've lost your mind!
of course i havent, i was lookin up research on electric toothbrushes, and anthropometric data on the hand.
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
I have noticed that programs that use GDI+,
when their windows is moved particially
outside of the screen area, when they are
moved back, they start redrawing everthing
from the beginning (which is very slow).
This doesn't happen with OpenGL or DirectX
programs (lets say: all of them show some
3D objects: a cube, some lines, etc - nothing
more). Why happens this to GDI+ programs?
What should be done to avoid it?
SHould I post a specific link to an example
of this effect?
|
|
|
|
|
Zibar wrote:
Why happens this to GDI+ programs?
Basically this depends on how the application was written. You can specify the clipping region of your screen that gets redrawn with GDI+. I would suggest reading the article : Professional C# - Graphics with GDI+[^]
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
I am not able to get a list of Users from my Domain Controller using a DirectorySearcher. I am catching an execption "A referral was returned from the server". I have added setting the RefferalChasing option to 'all' and I still get the same exception. The Domain, and Server are correct(changed here to protect the guilty).
Does anyone have any ideas?
DirectoryEntry Root = new DirectoryEntry("LDAP://Domain/cn=Users,DC=Server");
DirectorySearcher Searcher = new DirectorySearcher(Root);
Searcher.ReferralChasing = ReferralChasingOption.All;
try
{
SearchResultCollection Results = Searcher.FindAll();
foreach(SearchResult Res in Results)
{
Console.WriteLine(Result.Properties["cn"][0]);
}
}
catch(Exception Ex)
{
Console.WriteLine(Ex.Message);
}
John Marshall
JMarshall@aafcu.com
|
|
|
|
|
http://codeproject.com/csharp/GroupAndMembers.asp[^]
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I'm have two listboxes and I have to set it up so I can drag items from one box to the other, including multiple items if they are selected with the ctrl or shift key. I've got it working at the moment, but it seems like a horrible cludge and I wondered if they're isn't a better way?
This is what I'm doing:
For the source listbox (it only has to go one way, BTW), I set up the ItemDrag event to create a DataObject and then set it to the SelectedItems[0] with the DataFormats.Serializable because apparently the collection it's self isn't serializable. Then I call DoDragDrop with my DataObject.
For the target box I set the DragEnter event to first check if the data is Serializable using GetDataPresent. I then try casting the data to a ListViewItem (catching the exception if it won't cast). Then, if it casted okay I check that it actually came from right ListViewBox. If all these tests are passed I set DragDropEffects to Copy (otherwise none).
Then for the DragDrop event in the target box I just ignore the data being passed (because it was already checked by DragEnter) and just copy all the SelectedItems into the target box.
It seems to work okay, but it doesn't seem like the most elegant way of doing things. Does anybody have a better or more efficent routine? Also, is there any simple way to get the outline dragging that you see in Explorer? If so how do you go about this?
Thanks
WJ
|
|
|
|
|
i have created a simple service in c# i wanted to install it on xp plataform but when i use the command
installutil C:\mcWebService\bin\Debug\mcWebService.exe
(let me say first thats not web service thats a window service)it executed successfully but i did not find any
mcWebService service in service list.
whats the problem?
can any body provide the windows services example links?
i will be very thank full to u?
r00d0034@yahoo.com
|
|
|
|
|
What is mcWebService?
To install a web service, all you need to do is copy it into an IIS5 "application" folder.
Paul
|
|
|
|
|
It's not a WebService...he's having the obligatory problems with Windows Services that everybody seems to have...
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
I had the same problem when I played with windows services.
Not sure how to fix it.
|
|
|
|
|
|
yes i have created but i could not successed to install it ?
how to do that?
r00d0034@yahoo.com
|
|
|
|
|
I am trying to figure out how to set up a listview control so I can draw the items myself. Can anyone help me with this?
Thanks in advance for taking time to help me out!
dpb
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
|
I use this C# code to read a text file line-by-line, process each line and then write it back to disk. It works beautifully, if the file contains only the first 127 ASCII chars. The chars 128-255 are simply skipped. How can I fix this?
StreamReader sr = new StreamReader(m_sSrcFileName);
StreamWriter sw = new StreamWriter(m_sDestFileName);
try {
long savedBytes = 0;
do {
string oldline = sr.ReadLine();
string newline = ProcessLine(oldline);
savedBytes += oldline.Length - newline.Length;
sw.WriteLine(newline);
} while (sr.Peek() != -1);
Console.WriteLine(savedBytes + " Bytes saved");
return savedBytes;
}
Remember that the input files are not 2-bytes-unicode, but 1-byte-extended-ASCII.
Thank you in advance.
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
Have you tried System.Text.Encoding.ASCII ?
eg. StreamReader sr = new StreamReader(m_sSrcFileName, System.Text.Encoding.ASCII);
Paul
|
|
|
|
|
Yep I tried your suggestion and now it does not get skipped, however it writes back the wrong char to the file: for example the ù char becomes ?... I also tried to set the same encoding for the StreamWriter but with no success... do you have other suggestions?
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
Have you tried the encodings such as UTF8?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Luca Leonardo Scorcia wrote:
ù char becomes ?...
Ooops, sorry, saw "ASCII", didn't see "Extended".
Hmmm... supported codes:
Encoding.ASCII
Encoding.Unicode
Encoding.BigEndianUnicode
Encoding.UTF7
Encoding.UTF8
While the U in UTF is Unicode, I'd lay good money that they are 7 and 8 bit versions, so I'm guessing leppie is right to suggest UTF8.
Paul
|
|
|
|
|
Nope. I tried every encoding, apart from BigEndianUnicode... and it does not work. Now I don't have time enough to do a deep debug session, but I promise that tomorrow I'll try again...
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
Seems Encoding doesn't support Extended ASCII - now that is bizarre.
You might be well advised to open a standard stream, rather than a text stream, read the whole lot into a byte array and convert that to a string (possibly using System.Text.Encoding.GetChars, at worst using a for loop).
Paul
|
|
|
|
|
1) How do I cause a certain tab in my tab control to be automatically selected when a user does the follow:
a) Clicks an option in the Tree Control.
b) Clicks an option in from the Menu on the top toolbar.
Many Thanks,
Derek Smigelski
|
|
|
|
|
pls help this problem,
As you know, you can't delete minimize/maximize button in MDI child form
even if you set the FormBorder to None.
So I override resize method of childform.
But After that, I can't put button in groupbox of child form 'cuz
application lost focus when child form appears.
Here is very simple example,
Form1.cs<br />
-------------------------------<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
namespace SimpleTest<br />
{<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
private System.Windows.Forms.MainMenu mainMenu1;<br />
private System.Windows.Forms.MenuItem menuItem1;<br />
private System.ComponentModel.Container components = null;<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
protected override void Dispose( bool disposing )<br />
{<br />
if( disposing )<br />
{<br />
if (components != null)<br />
{<br />
components.Dispose();<br />
}<br />
}<br />
base.Dispose( disposing );<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
this.mainMenu1 = new System.Windows.Forms.MainMenu();<br />
this.menuItem1 = new System.Windows.Forms.MenuItem();<br />
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {<br />
this.menuItem1});<br />
this.menuItem1.Index = 0;<br />
this.menuItem1.Text = "New Form";<br />
this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);<br />
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);<br />
this.ClientSize = new System.Drawing.Size(292, 273);<br />
this.IsMdiContainer = true;<br />
this.Menu = this.mainMenu1;<br />
this.Name = "Form1";<br />
this.Text = "Form1";<br />
<br />
}<br />
<br />
static void Main()<br />
{<br />
Application.Run(new Form1());<br />
}<br />
<br />
private void menuItem1_Click(object sender, System.EventArgs e)<br />
{<br />
Form2 childForm;<br />
<br />
childForm = new Form2();<br />
childForm.MdiParent = this;<br />
childForm.Show();<br />
<br />
}<br />
}<br />
}<br />
<br />
<br />
Form2.cs<br />
--------------------------------<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
<br />
namespace SimpleTest<br />
{<br />
public class Form2 : System.Windows.Forms.Form<br />
{<br />
private System.Windows.Forms.GroupBox groupBox1;<br />
private System.Windows.Forms.Button button1;<br />
private System.ComponentModel.Container components = null;<br />
<br />
public Form2()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
protected override void Dispose( bool disposing )<br />
{<br />
if( disposing )<br />
{<br />
if(components != null)<br />
{<br />
components.Dispose();<br />
}<br />
}<br />
base.Dispose( disposing );<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
this.groupBox1 = new System.Windows.Forms.GroupBox();<br />
this.button1 = new System.Windows.Forms.Button();<br />
this.groupBox1.SuspendLayout();<br />
this.SuspendLayout();<br />
<br />
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {<br />
this.button1});<br />
this.groupBox1.Location = new System.Drawing.Point(64, 64);<br />
this.groupBox1.Name = "groupBox1";<br />
this.groupBox1.Size = new System.Drawing.Size(192, 128);<br />
this.groupBox1.TabIndex = 0;<br />
this.groupBox1.TabStop = false;<br />
this.groupBox1.Text = "groupBox1";<br />
<br />
this.button1.Location = new System.Drawing.Point(40, 40);<br />
this.button1.Name = "button1";<br />
this.button1.Size = new System.Drawing.Size(80, 40);<br />
this.button1.TabIndex = 0;<br />
this.button1.Text = "button1";<br />
<br />
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);<br />
this.ClientSize = new System.Drawing.Size(292, 273);<br />
this.ControlBox = false;<br />
this.Controls.AddRange(new System.Windows.Forms.Control[] {<br />
this.groupBox1});<br />
this.MaximizeBox = false;<br />
this.MinimizeBox = false;<br />
this.Name = "Form2";<br />
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;<br />
this.Resize += new System.EventHandler(this.Form2_Resize);<br />
this.groupBox1.ResumeLayout(false);<br />
this.ResumeLayout(false);<br />
<br />
}<br />
<br />
private void Form2_Resize(object sender, System.EventArgs e)<br />
{<br />
this.MaximizeBox = false;<br />
this.WindowState = FormWindowState.Maximized;<br />
}<br />
}<br />
}<br />
<br />
-------------------------------
Anyone has same problem with me?
I think this is another bug of MDI in .NET......
- Zaharang
|
|
|
|
|
Hello,
I write program which uses some functions from legacy dll written in Delphi.
The problem is that Delphi have type "shortstring" which is very specific for this language and I can't marshal this type.
Pascal code:
<br />
...<br />
type<br />
TDLLIn = record<br />
....<br />
Typekey: shortstring;<br />
end;<br />
<br />
<br />
function Init(dllIn: TDLLIn): integer;<br />
begin<br />
....<br />
end;<br />
C# code:
<br />
public struct TDLLIn<br />
{<br />
....<br />
<big>[MarshalAs(UnmanagedType.AnsiBStr)]</big><br />
public string Typekey;<br />
}<br />
<br />
public class Wrapper<br />
{<br />
....<br />
[DllImport("DelphiDLL.dll", CallingConvention=CallingConvention.StdCall, EntryPoint="Init")]<br />
static extern int Init(TDLLIn dllIn);<br />
}<br />
I've tried marshal as AnsiBStr, as byte array (MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.U1)) and many others ways but still no success.
Marshaling Pascal shortstring is impossible for me.
If anyone found a way to do this please inform me.
Best regards
Adam Plucinski
|
|
|
|