|
Hi
I have a datagridview in that i have a comboboxColumn
Now i want to set the default value for that so that each newly added row have that default value of the combobox
It means that if the ComboBox values are DR. & Cr.
Then Dr. is default value for that combo in the datagridview column when a new row is added.
Thanks a lot in advance
Katinka
|
|
|
|
|
Try this :
DataGridViewCellStyle.NullValue = "Dr";
U can Do that Visually
Or by writin your'e self The Code
Have Fun
Never forget it
|
|
|
|
|
HY!!!
Thanks a lot!
Have a nice day!
|
|
|
|
|
Dear Gentlemen,
I am stuck with a problem of picturebox. I am working on a map related application in C#. what i deed was, i put the map in the picture box .An object moving in real time, is tracking in the map using longitude and latitude from GPS reciever.
But what i need is to slide the map in the picturebox smoothly if the longitude and latitude is out of the map's longitude and latidue defined in the picturebox?
I would be greatful if any body help me in this matter.
Padam Raj Gurung
|
|
|
|
|
Hi,
forget the PictureBox; replace it by a regular Panel plus some code:
- some initialization to load the picture
- a Paint handler to paint the relevant part of the Image in the Panel, using one
of the many overloads of Graphics.DrawImage().
By adjusting the source rectangle (one of the parameters in DrawImage) you can get any
pan&zoom you want; to update the display, you should adjust the parameters and call
Panel.Invalidate().
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi,
i like to know how to make a Uniqe Color ,like mixed Colores
or maybe Stripes on my UserControl BackColor
Any Idea???
-- modified at 8:51 Tuesday 6th November, 2007
Have Fun
Never forget it
|
|
|
|
|
half-life wrote: how to make a Unique Color
hum? i suggest that it is better if you explain more details about what you wanna do... I'm not so sure what you meant by "how to make a unique color"? let's say "White".. Is it not unique??
|
|
|
|
|
Like :
Blue & Red Stripes O.K
i've UnderStand that i've got to voerride the onPaint...
Can't i Import A Color????
Have Fun
Never forget it
|
|
|
|
|
You will have to develop your own property to set the effects that you would like. Then you will need to override the OnPaintBackground method.
<br />
protected override void OnPaintBackground(PaintEventArgs e)<br />
{<br />
}<br />
|
|
|
|
|
got U
THANKS
P.S
Can't i Import A Color????
Have Fun
Never forget it
|
|
|
|
|
Import a colour?
I'm not sure what you mean, but there's a couple of ways you can get a colour:
1: By Name
Color myColour = Color.DarkGreen;
2: Specify the RGB values
Color myColour = Color.FromRGB(50, 255, 200);
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
|
Though not stripes, I threw this example together. You can paint anything in OnPaintBackground.
<br />
Color m_Color1 = Color.Red, m_Color2 = Color.Black;<br />
<br />
public Color Color1<br />
{<br />
get { return m_Color1; }<br />
set { m_Color1 = value; }<br />
}<br />
<br />
public Color Color2<br />
{<br />
get { return m_Color2; }<br />
set { m_Color2 = value; }<br />
}<br />
<br />
protected override void OnPaintBackground(PaintEventArgs e)<br />
{<br />
Brush brush = new System.Drawing.Drawing2D.LinearGradientBrush(new Point(e.ClipRectangle.Left, e.ClipRectangle.Top), new Point(e.ClipRectangle.Right, e.ClipRectangle.Bottom), m_Color1, m_Color2);<br />
e.Graphics.FillRectangle(brush, e.ClipRectangle);<br />
}<br />
|
|
|
|
|
Nice and Cool
THNKS
Have Fun
Never forget it
|
|
|
|
|
it is un believiable:
but the TabPage control do not have the :
Enabled, Visiable - Properties????
what in |The world gone wrong????
but The most ridiculous thing is that microsoft say u have them
But they Addes : "This member is not meaningful for this control."
Why???
So my problem is this :
i like to disable a tab when it is not meaningful without the selected index Property
Any Ideas????
Have Fun
Never forget it
|
|
|
|
|
Well, you could remove the tab page when its useless, and add it back again when it becomes usefull. I'm pretty sure each tab page is a whole separate object.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
|
The tabPage exists within the form and removing it from the tabControl means that it is not shown. You want to be careful not to re-add the tabPage control or to remove it if its not there.
|
|
|
|
|
Yah, i know
But i decided to just disable all of the objects inside of the TabPage
THANKS anyway
Have Fun
Never forget it
|
|
|
|
|
once my boss told my to disable a tabpage...
when told him that is not possible he laughed at me
and told me do some reading
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
|
You're right, but there is a very easy workaround for this problem.
1. Create a new tab control that is hidden on your form.
2. When you want a tab page to go away, Set the .Parent property of your tab page = to the hidden Tab Control object.
3. When you want the tab page back, Set the .Parent property of your tab page = to the visible Tab Control Object.
Enjoy!
Hogan
|
|
|
|
|
THANKS
i'll try it
Have Fun
Never forget it
|
|
|
|
|
I have situation in code where I have to deal with the File Creation Time.
I have used System.IO.File class to check for the existence of the File and then deleted it, then in another function created the File using FileStream Class with FileMode.Create and CreateNew Parameter.
File is delete in both cases from disk, (as it shows in the folder - with FileInfo and System.IO.File) but when the File is created again with FileMode.Create and FileMode.CreateNew, it has the older creation date i.e. the date of the deleted file.
Can anyone help on this with a thorough and solid answer?
Muhammad Talha
|
|
|
|
|
Well, it seems strange that it would keep the old date/time but i'm sure there's a reason.
Until you find out why, you can set the creation time yourself. Sadly, i can't remember where exactly you do that, you may need to do a bit of googling.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|