|
OK, I see now, except that I'm not sure if you implemented your own UITypeEditor or not. Anyway, using your own one or the default one, you won't be able to show the dropdown box and at the same time to have the focus in the textbox to let the user continue typing. This is even the same in Smart PropertyGrid. So how did I implement it in SPG ? I used the autocompletetion feature of the textbox. It looks something like that in my code:
string[] displayedValues = propEnum.Property.Value.GetDisplayedValues();
if (displayedValues.Length > 0)
{
System.Windows.Forms.AutoCompleteStringCollection coll = new System.Windows.Forms.AutoCompleteStringCollection();
coll.AddRange(displayedValues);
tb.AutoCompleteCustomSource = coll;
tb.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
tb.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
}
tb is the textbox, so since you have a hack to get access to your textbox, you could maybe do the same. I can assure you that this a waste of time to try to do it with the UITypeEditor in the MS PropertyGrid.
|
|
|
|
|
Oh dear, I think I have a lot of troubles dealing with common controls today..
tabControl1.SelectedTab.Font = new Font("Tahoma", (float)8.25, FontStyle.Bold);
The above line is simply not working! May I know how do you manage to do it?? "Changing the currently selected tabpage font"
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello Muammar,
The Font of the Text you see in the Tab Selection is not a member of the TabPage itselve.
It is a member of the TabControl.
So if you set the Font property of the TabControl, all the TabPage writers will change.
If you whant to chenge only one (the active one), you better inherit you own TabControl and:
1)Set "this.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;" in the Constructor
2)override OnDrawItem:
protected override void OnDrawItem(DrawItemEventArgs e)
3)set a Font variable accordingly to EventArgs index:
Font actFont;
if(e.Index != this.SelectedIndex)
{
actFont = e.Font;
}
else
{
actFont = new Font("Tahoma", (float)8.25, FontStyle.Bold);
}
4)write the Text (using System.Drawing)
using(StringFormat sf = new StringFormat())
{
sf.Alignment = StringAlignment.Center;
e.Graphics.DrawString(this.TabPages[e.Index].Text, actFont, Brushes.Black, e.Bounds, sf);
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Thanks Martin
That was a great help indeed!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
You are wellcome!
Glad I could help!
All the best,
Martin
|
|
|
|
|
Hello
I want to reload the new data from the dataset into the DataGridView
how i can do ?
This my code:
adap.SelectCommand = cmd;
ds.Tables.Remove("CreditCardInfo");
adap.Fill(ds, "CreditCardInfo");
dtgCreditInfo.DataSource = ds;
dtgCreditInfo.DataMember = "CreditCardInfo";
txtNewCustName.Text = dtgCreditInfo.Rows[0].Cells["CreditCardOwner"].Value.ToString();
dtgCreditInfo.Update();
this not work, can someone tell me what i should do ?
Assaf
|
|
|
|
|
Hi there .
Is there any way to change log on account of services ?
For example : we have SQL Server(INSTANCENAME) service and it logged on by 'NT AUTHORITY', now i want to know clear, how can i tell this service log on by Local System account .
Thank you all .
DMASTER
|
|
|
|
|
Good evening truly people,
With all due respect, may I know how HOW THE HELL do I get a node selected using the right mouse button and then show the context menu..
I'm trying this
private void tree_Level_MouseDown(object sender, MouseEventArgs e)
{
tree_Level1.GetChildAtPoint(tree_Level.PointToClient(new Point(e.X, e.Y)).Select();
}
Then I managed to show the context menu but once that happens, it goes back and selects the old node
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Use the AfterSelect event instead.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete and thanks for the help.. Actually, it was already in the AfterSelect event and I had to move it to obtain the mouse location value form the passed arguments. If you tried to run the piece of code I just pasted, it will simply not work anywhere not just out of the AfterSelect event!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
In the NodeMouseClick event:
treeview.SelectedNode = treeview.GetNodeAt(e.Location);
|
|
|
|
|
Hey! Thanx a bunch buddy, that was a great help!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Hi,
In my VS2005 Add-in i need the constructor and classname from a cs file. Now i run through all the lines of the file looking for a line containing "class" and not commented ofcours, but i was wondering if there is another way using the projectitem.document?
thx
Kurt
|
|
|
|
|
Just parse through them. Maybe use regular expressions
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I was just wondering,..
if the VS studio editor could recognize them and mark them with a color, maybe the functionality is available also on the projectitem.documents. So i guess the parsing already exists but how can we use them?
|
|
|
|
|
i know the meaning
now i implemented it in the project
using the following code
protected void Page_Load(object sender, EventArgs e)
{
Session["Sonia"] = "11";
Session["Sonia1"] = "12";
Session.Abandon();
foreach (string ste in Session.Keys)
{
Response.Write(ste + ":" + Session[ste]);
}
}
initially i used the two session variables.
if i use the session.clear()
it leave me with 0 session count
but the session vaiables remain the same if using the sesssion.abandon()
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Session.Abandon lets you access the session variables until the page goes out of scope (e.g. you redirect the user to another page). Session.Clear removes the variables instantly.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Session.Abandon marks the Session object to be abandoned. When the current request is finished, the Session object will be removed, but it's available as long as the code is running. When the user makes another request, a new Session object will be created.
Session.Clear only removes the session variables from the current Session object. The Session object itself will not be removed.
---
single minded; short sighted; long gone;
|
|
|
|
|
i am using the following code
Session["Sonia"] = "11";
Session["Sonia1"] = "12";
Session.Clear();
it renders the Session["Sonia"] and session["Sonia1"] to null.
Session["Sonia"] = "11";
Session["Sonia1"] = "12";
Session.Abandon();
leaves the session["Sonia"] AND Session["Sonia"] AS IT IS.
Is this what u mean to say.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: Session["Sonia"] = "11";
Session["Sonia1"] = "12";
Session.Abandon();
leaves the session["Sonia"] AND Session["Sonia"] AS IT IS.
Is this what u mean to say.
This is correct. Once you leave the scope of the request, Session["Sonia"] and Session["Sonia1"] will be removed, but until then you can still access these variables.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
but the fucntion session.clear() clears the session values not the session key.
here session.clear() clears the session key as well, y this is happening
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: but the fucntion session.clear() clears the session values not the session key.
No, it doesn't clear the values, it removes the items.
Sonia Gupta wrote: here session.clear() clears the session key as well, y this is happening
The Session.Keys collection is a collection of the names in the Session.Items collection. As Session.Clear removes all the items in Session.Items, the Session.Keys collection also becomes empty.
---
single minded; short sighted; long gone;
|
|
|
|
|
one thing i wanted to make clarification about is that
session.abandon() does not remove the key or the value until we navigate to another page.Once the use navigates to another page , both the key and the value gets removed.
and as far as the removing of session key and value is concerned , session.clear() method is sufficient , according to my understanding . Then What's the need of session.abandon()?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Suppose that you want to continue working with the session in the context of the page, but you want the session to be cleared when you leave the page. If your page hosts another page in an iframe, then the inner page also has access to the session variable. This means that you can abandon the variable in the Page_Load, and still access it in the inner page.
Deja View - the feeling that you've seen this post before.
|
|
|
|