|
write
Application.DoEvents();
before writeing
this.Dispose(); or this.Close();
|
|
|
|
|
What is suppose to dispose here either that user control or main form itself,
If i dispose the user control will it close the user control's message box.
I want dispose only the messagebox, not the user controls,
am i clearly explained situation?
|
|
|
|
|
You can't close the messageboxes, at least not easily. Make your own dialog box to use as messagebox, so that you can control it.
---
b { font-weight: normal; }
|
|
|
|
|
Don't reinvent the wheel, all the hard stuff for a timeoutable messagebox clone was already done here. I wrote a MessageBox esque wrapper because I didn't like the provided controller, it took about a day to do. Having a unique name for each messagebox and suffing them all into a single container probably would make things easier for localization.
http://www.codeproject.com/cs/miscctrl/MessageBoxEx.asp?df=100&forumid=155440&noise=2&mpp=50&select=1661227&msg=1661227
|
|
|
|
|
hi.
i want to set button.Image Property by APPLICATIONS.ico that save as resource in My VS2005 as follow but an error occured when compiled my app :
in Form1_load event :
Bitmap _bitmap = global::AmlakButtons.Properties.Resources.APPLICATIONS; <br />
System.IO.MemoryStream _stream = new System.IO.MemoryStream(); <br />
_bitmap.Save(_stream,System.Drawing.Imaging.ImageFormat.Bmp);<br />
<br />
System.Drawing.Size _size = new Size((btn_fish.Width / 2) - 20, btn_fish.Height - 5); <br />
ImageList list = new ImageList();<br />
System.Drawing.Icon _icon = new System.Drawing.Icon(_stream,_size ); -> Error in this line<br />
System.Drawing.Image _image = Image.FromStream(_stream,_size ); <br />
list.Images.Add(_icon);<br />
btn_fish.ImageList = list;<br />
btn_fish.ImageList.ImageSize = _size;<br />
btn_fish.ImageList.TransparentColor = Color.Black;<br />
btn_fish.ImageIndex = 0;
but when i use _image in list.Images.Add(_image); my Program worked correctly but bacause set btn_fish.ImageList.TransparentColor = Color.Black; the black color of icon will be removed .
How to solve my problem ?
|
|
|
|
|
I have a form that i instanciate via Reflection from an external Assembly. My problem is that i need to execute some methods implemented in that form by an interface.
|
|
|
|
|
If you are able to include the source of the interface or reference the assembly which defines the interface you can create a variable of the interface type and simply cast the object instanciated via reflection.
Otherwise go on using reflection to invoke those methods (Type.GetMethod , MethodInfo , Type.InvokeMember ).
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Tank you for your reply.
I already did the second way but i want to try the first way to make my choice.
How can i create the object and I realize the cast?
Can you help me?
|
|
|
|
|
Assuming your interface is named "IMyInterface" you will have something like:
IMyInterface var = (IMyInterface) Activator.CreateInstance(formType); with formType being the type object of your form.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
I am working on a C# WinForm application which allows user to compare items by entering a numeric value.
Can anyone suggest how to implement such a component like the following?
----------------
| - | A | B | C |
----------------
| A | X | 1 | 3 |
----------------
| B | X | X | 8 |
----------------
| C | X | X | X |
----------------
A,B,C, are the items to compare and the numbers are weight for the paiwise compairson
between two items.
Regards,
Edwin
|
|
|
|
|
Hi!
I load names and values into a listbox. I sorted the listbox. Is there anyway to make the highest value to appear first? I should work as a highscore board. Only the 10 best scores should be displayed. Any suggestions?
namn is name and procent is the score:
while ((line = sr.ReadLine()) != null)
{
for (int i = 0; i < 1; i++)
{
varden = line.Split(' ');
Procent = Convert.ToDouble(varden[0]);
Namn = varden[1];
listBox1.Items.Add(Procent + " " + Namn);
listBox1.Sorted = true;
}
}
Newbie untill I die!
|
|
|
|
|
Hi ,
i want to use USB for reading and writing the data in VC#.Net 2003 and framework 1.1
How can i access that
plz help on this topic
Thanks
|
|
|
|
|
You really need to be more specific. Are you wanting to read and write data onto a USB flash drive, you merely have to address it as any other drive.
Otherwise, you need to access it through the API of the driver, or write your own driver for the hardware. Check with the hardware manufacturer for a development kit.
|
|
|
|
|
Hi! i want to retrieve data from clipboard. for this i m using code of line.
System.Windows.Forms.IDataObject clipboardData = System.Windows.Forms.Clipboard.GetDataObject();
this code run on windows server 2000 successfully. but on windows server 2003 it is thrown an exeption: Requested Clipboard operation did not succeed.[System.Runtime.InteropServices.ExternalException]
please help me.
Amit Kuamr Pandey
|
|
|
|
|
i wnat to plot(IN GRAPH) the elenments ,vaLUES IN ARRAY
|
|
|
|
|
Maybe this suit your needs: A flexible charting library for .NET[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
Can any one help me in creating a range validation custom attribute (integer).
Thank you,
regards
Praveen
|
|
|
|
|
Ive just developed my first little grid control (based on Control), and because of negligence on my part, it took some figuring out that I need to Invalidate my whole area in the OnResize method to redraw the grid lines (in OnPaint) correctly every time the control is sized. I would love to find a resource that explains the lifecycle, the event model, owner drawing, etc. Pointers to good articles or sites would be greatly appreciated.
|
|
|
|
|
Cant answer your direct question, but something to consider is that you can use SetStyle within your control to set the ResizeRedraw bit to automatically redraw your control on resize
this.SetStyle(ControlStyles.ResizeRedraw,true);
|
|
|
|
|
Hi all,
I have the problem to keep the current added line in a RichTextBox in view. So the text should be scrolled if it exceeds the frame range.
I tried it with ScrollToCare method but it has no visible effect.
The code snippet should place the cursor always at the current position
but it does not scroll to the end of the lines. I tried 3 versions with no effect.
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
this.richTextBox1.Clear();<br />
for(int i=0; i<200; i++)<br />
{<br />
this.richTextBox1.SelectedText = "Index = " + i.ToString() + "\r\n";
this.richTextBox1.ScrollToCaret();<br />
}<br />
}<br />
catch{}<br />
}
What's wrong ?
Tnx in advance
Regards
Frank
|
|
|
|
|
Use
this.richTextBox1.SelectionStart = this.richTextBox1.text.Length;
Hope it'll solve your problem
sameer
|
|
|
|
|
Thank's
No - that's not the solution.
Frank
|
|
|
|
|
try this
richtext1.text.selectionstart = richtext1.text.length;
richtext1.scrolltocaret();
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Hi,
that's what I have already tried - with no success.
this.rTB_Info.Clear();<br />
for(int i=0; i<200; i++)<br />
{<br />
this.rTB_Info.SelectedText = "Index = " + i.ToString() + "\r\n";<br />
this.rTB_Info.SelectionStart = this.rTB_Info.Text.Length;<br />
this.rTB_Info.ScrollToCaret();<br />
}<br />
Some new ideas ?
Tnx
Frank
|
|
|
|
|
Dont call the Clear method
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|