|
it would be great if i could paint on the picture box...but i dont know...that code draws on the form.
rzvme
|
|
|
|
|
I am using the paint event of the picture box to draw on it and i'm calling the refresh method on it from the form
rzvme
|
|
|
|
|
Hey
Can somebody please tell me how to make code that opens a specifik file with Windows media player from a specifik folder on a Pocket pc 2003?
I hope someone can help me...
|
|
|
|
|
I have an XML definition which I want to incorporate as a resource within my application. I need to be able to get the XML definition out of the resource file, and get it into a stream so that it can be fed into the XmlSerializer.Deserialize() method.
I am getting the data into a string using ResourceManager no problem. I tried a MemoryStream, but I get an error that there is invalid XML in the header with the following code:
ResourceManager manager = new ResourceManager( typeof( SmartClient.buttonDef ) );
string item = manager.GetString( "buttonDef" );
MemoryStream stream = new MemoryStream();
UnicodeEncoding uniEncode = new UnicodeEncoding();
stream.Write( uniEncode.GetBytes( item ), 0, item.Length );
XmlSerializer serializer = new XmlSerializer( typeof( DefinitionFile ) );
file = ( DefinitionFile )serializer.Deserialize( stream );
Does anyone have a suggestion on how to go about doing this so that the Deserialize call works correctly??
|
|
|
|
|
I'm writing a program that has multiple groups of multiple radio buttons on a form. When a radio button is clicked, I use for loops to determine if one radio button from each group has been selected. If it is then I execute the following code:
for (int i = 0; i < 4; i++)
{
this.rating[i].Enabled = false;
this.rating[i + 4].Enabled = true;
this.radioGroup[i].Enabled = false;
this.radioGroup[i + 4].Enabled = true;
}
All is well and good, except when any radio button in a 3rd group is clicked last and it reaches the line this.radioGroup[i].Enabled = false; the program jumps out of my loop and executes the code as if a radio button has been clicked. radioGroup is an array of panels and this only occurs when I click the 3rd group of radio buttons. Also, it gets through fine during the second execution of the code and returns to where it left off the first time through.
My question is why would the radio button event handler be fired when I disable a panel from my form? Has this happened to anyone else and if so, what can I do to fix it?
Thanks in advanced for the help, and this is my first posting here on CP
~Yeck
|
|
|
|
|
Have you single stepped through your code at the time you set the enable bit? If so does the step path take you through a section where you set a value on the radio button?
|
|
|
|
|
I have stepped through the program. The code is within a handler for radioButton clicks and directly after disabling the panel it jumps to the beginning of the handler. The thing that disturbs me the most is that it only occurs when one of the radio buttons from the third row is clicked last, and yet the radio buttons are initiallized within a for loop.
|
|
|
|
|
Are any of the radiobuttons being disabled selected? IF so, I'd assume disabling them is also unselecting them, and the checked event handler fires for both selection and unselection of the button.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
The radioButtons themselves are not being disabled, but rather the panel they are children of. However, disabling the parent may cascade down to the child, so I'll have to look into this. The radio buttons appear grayed out, but still have the dot in the one that was selected. My gut tells me the disable call doesn't get cascaded down.
~Yeck
|
|
|
|
|
Hello... Iam working in C# .NET 2005. Iam working in Windows Application Form and I have a DataGriVview to display information from a table .DBF. I would like add a OLE navigatior but not record by record. I need navigator like a scroll down and up, many records at the time. I would like create a user control to do that, but I need some idea.
Furthemore, I need create a Search for some fields... The scroll could be 20 records at the time.
Ex: the buttons seems like
First Page -- Previos page -- Next Page -- Last Page -- Search
Please, I need some idea and the Search engine how can I implement at this point.
Thanks in advance
Maite Lazo
|
|
|
|
|
take two DataTable.one table fill with all records and second table fill only those recods which you to show at a time and set secod table as the datasourcr of your grid. e.g. lets first table contains 100 Row and you want to show 10 reocrd at a time so simply select 10 records from the first table (DataRow []dr= firstTable.Select("ID>=1 AND ID<=10"); ) Now import those rows in second table.
SecondTable.Clear();<br />
for(int i==0;i<dr.Length;i++)<br />
SecondTable.ImportRow(dr[i]);
|
|
|
|
|
Hello everybody
I am trying to make a form with height 0 and then increment it BUT when I set it to 0 it changes to 34. I put the formBorderStyle to None and still it doesn't work.
Please if anyone can help I will be very very grateful
I am using VS 2005 .NET 2.0 and C#
-- modified at 11:24 Friday 3rd November, 2006
|
|
|
|
|
this.AutoScroll=false;
form should be border less
now in Load event of the form write
this.Size=this.MinimumSize;
Now try to see your form
|
|
|
|
|
Thanks a lot.
It didn't work again but anyway I found another way without setting it to 0.
|
|
|
|
|
I am trying to create a drop-down color picker control. I have the control working by displaying a form as my popup. If the user clicks off the form, I am using the Deactivate event to close the form.
My issue is I am not convinced using a form for the popup is the best way to implement this. Previously in Visual Basic I poped-up another control and use the SetFocus API to determine if the user clicked outside of the popup.
Can anyone offer any advise on the best way to build a pop-up / drop down user control in c#?
Thanks
|
|
|
|
|
See this article at vbAccelerator it explains how to detect alt-tab and other events that you might not catch. I think a form is probably the best way to do it as it can hang outside the main window if neccessary.
|
|
|
|
|
Hi, Any method or Class available for getting the following purpose served ?
== Situation==
My software has navigated an website and extracted a link from
<a href="/abc/def/ghi.JPG">Click Here</a>,
and the URL of the navigated website is
http://www.myWebSite.com/pictures/good/
== Purpose ==
Now, I want to contruct a Full abosolute URL of the Image link based on the Website URL like this,
http://www.myWebSite.com/abc/def/ghi.JPG
==================
== QUESTION ==
IS THERE ANY CLASS that can do these works for me or I will have write all dirty codes to do this job !!
Thanks and I appreciate your help in advance.
Emran
|
|
|
|
|
|
Thanks,
I used this convention ~ in ASP.NET, but this is I am doing for WinForm. Will ~ works for WinForm Application As well ?
Thanks
|
|
|
|
|
You could try using the UriBuilder class:
<br />
UriBuilder builder = new UriBuilder();<br />
builder.Host = "www.myWebSite.com";<br />
builder.Scheme = "http";<br />
builder.Path = System.IO.Path.Combine("pictures/good", @"/abc/def/ghi.JPG");<br />
<br />
string absoluteUrl = builder.Uri.AbsoluteUri<br />
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
hi!
i'm using VS 2005 express to build C# .NET 2.0 windows applications.
I've done a simple user control with 3 pictures box which are vumeter for cpu, ram and network bandwith. the width of the picture box go from 1 to 100 pixels in relation with pourcentage of cpu used, ram used or network bandwith used.
On a timer (each 500 ms), i get all informations to calculate correct vumeter width and set tooltips on this vumeter to show informations when mouse is over vumeter.
My probleme is that this user control eat a lot of RAM (2 mo per minute if timer is set to 10 ms) because of tooltips. If i put tooltips code in comment, all is ok.
so i think there's a problem in .NET framework with tooltips on Picture box.
can someone confirm this bug in .NET 2.0 ?
a little test :
- create a new windows application
- create a flow layout panel on main form
- create a usercontrol with a picture box and a timer (10 ms interval)
- on each timer tick, set a tooltip on the picture box
- add this usercontrol on the flow layout panel
here is my tooltips parameters
automaticdelay = 1
autopopupDelay = 60000
initialDelay = 1
reshowDelay = 0
showAlways = true
run your program for some time (10 min) with or without the setTooltips and watch ram used by the application.
am i mad or there's really a probleme on .NET framework ?
Fabrice Deshayes aka Xtream
http://www.xtream.be
|
|
|
|
|
Are you creating a new tooltip each time? I would check there for any memory leaks.
Are you sure it's actually a memory leak, or is it that GC hasn't happened yet?
|
|
|
|
|
no, i'm not creating a new tooltips each time. I've only one tooltip component that i've drag'n dop on my usercontrol. The only thing i'm doing is :
myTooltip.setTooltip(myCpuVumeter, myCpuString);
myTooltip.setTooltip(myMemoryVumeter, myMemoryString);
myTooltip.setTooltip(myNetworkVumeter, myNetworkString);
myTooltip is created only one time in the designer generated C# code.
the 3 Strings are private variables of my class. i don't do a new in the timer for these string, only change their content like this :
myCpuString = String.Format(resources.GetString("SysInfos_17"), cpuUsed);
i don't think GC hasn't happened yet because i've wait long hours and days and memory increase without ending.
with comments on setTooltips code lines, i'm running my apps fine in 39 mo since an hour.
if i let the 3 setTooltips code lines, i'm at 100 mo in 20 minutes!
|
|
|
|
|
Does it only occur if you have a picture box in a user control in a flow layout?
---
b { font-weight: normal; }
|
|
|
|
|
i've done the test and put it here
http://perso.wanadoo.fr/xtream/TestTooltipsMemoryLeak.zip
only a form with 3 picture box and a timer which change tooltips value on picture box.
Timer is disable by default, you've got to press button to enable it and watch memory used with windows task manager.
it seems that there's a memoryleak in the setTooltip method.
can someone try this apps (sources and binaries (in bin/debug) are include) and watch used memory with timer on and off to tell me if there's any trouble ?
for me, there's approximatly 1 mo per minute which is consumed and never released when timer is on.
|
|
|
|