|
please provide your Feedback directly to MS on connect
'A programmer is just a tool which converts caffeine into code'
|
|
|
|
|
You might be aware that whenever the user clicks on the column header of a filled data grid view, the rows of the data grid view or sorted according to that column values.
How can i prevent this. I don't want the user to be able to sort the values.
|
|
|
|
|
just use the following code
for (int i = 0; i < dataGridView1.Columns.Count; i++)
{
dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
}
Hope that works for u...
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Just what i wanted.
Thanks a lot Pramod. It worked.
|
|
|
|
|
Tearing my hair out here.
I remember seeing an artical using the .net 2.0 WebBrowser combined with a tree control to decompose a web page or view xml conversion results in a tree.
Been looking all day stumbling across lots of other stuff that I book marked.
Thanks
|
|
|
|
|
Hello everyone!
OK, I need to write and read integers on a file... What's the best way to do this in C#? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Your subject talks about a specific way of doing this. Is that the exact way that you want to do it? Or would using a BinaryWriter be ok?
---
b { font-weight: normal; }
|
|
|
|
|
Hmm... Didn't know about that class! Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Hello,
Im looking for a way of changing the keyboard layout for a user-defines window.
Any one know how to achieve it ? or any software that does it ?
|
|
|
|
|
Hi
I don't know if there is a way to change your keyboard layout using the framework (managed code) but I think in famework 1.1 you should use the windows API
to do so first declare following API function in your class
<br />
[DllImport("user32")]<br />
private static extern int LoadKeyboardLayout(string pwszKLID,long flags);<br />
Then you can call this function to change the keyboard layout.
pwszKLID is a pointer to a buffer that contains the locale name.You should know the locale ID for your prefered language ( I think that you can find them on MSDN)
I don't know what are the flags ( you can find its values on MSDN) but we are using 1 and it's working fine.
Good Luck
|
|
|
|
|
I have a form with a picture box and i'm tring to draw an rectangle or an image on the picturebox.image or on the form (thou i'd prefer on the picture box ). the picturebox is sent to back and the form has 70% opacity
this is what i wrote:
myPoint.X = X;
myPoint.Y = Y;
Rectangle rect = new Rectangle(X,Y,10,10);
Image img = Image.FromFile("C:\\Project Data\\dot.bmp");
e.Graphics.DrawImage(img, myPoint);
pictureBox1.Refresh();
e.Graphics.FillRectangle(brush, new Rectangle(myPoint, new Size(10, 10)));
this.Refresh();
and it still doesn't work
can you tell me what i'm doing wrong, and if i cand draw on the picture box.image and how
rzvme
|
|
|
|
|
You need to draw onto the bitmap, how is this code working ? Is it inside the picture box ? If not, why are you calling DrawImage ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
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
|
|
|
|