|
Activate or recreate tooltip on MouseMove.
My english is bad. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
I have a COM object built in C#. Its a an IE deskband. It implements the following method:
<br />
[ComRegisterFunctionAttribute]<br />
public static void Register( Type t )<br />
Which gets called when regasm is used and it makes teh appropriate entries into the registry. Works great.
Now I am trying to build a installer for this using VS 2005. I did the following:
1. I added all assemblies to the GAC
2. I marked my dll as Regsiter vsdrpCOM in the property window.
The install works but my tool bar does not show up in IE.
The I tried the following:
1. I added all assemblies to the GAC
2. I added my dll to the prgram folder in addition to the GAC.
3. I marked my dll (the program folder one) as Regsiter vsdrpCOM in the property window.
Install works with no errors but toolbar does not show up in IE.
BUT, now if I use the commandline and regasm my dll (program folder one), bingo... everything works.
What do I have to do in the installer project to make this work. I know the installer lets you make registry entries, but I do not wish to do that. Its what the
<br />
[ComRegisterFunctionAttribute]<br />
public static void Register( Type t )<br />
is meant for.
My first hunch was that regasm was not working. On further inspection I realized that regasm was working but not completely.
My Register Method does the following:
<br />
if( 0 != ( style & BandObjectStyle.Vertical ) )<br />
rkCat.CreateSubKey( "{00021493-0000-0000-C000-000000000046}" );<br />
<br />
if( 0 != ( style & BandObjectStyle.Horizontal ) )<br />
rkCat.CreateSubKey( "{00021494-0000-0000-C000-000000000046}" );<br />
<br />
if( 0 != ( style & BandObjectStyle.TaskbarToolBar ) )<br />
rkCat.CreateSubKey( "{00021492-0000-0000-C000-000000000046}" );<br />
<br />
if( 0 != ( style & BandObjectStyle.ExplorerToolbar ) )<br />
Registry.LocalMachine.CreateSubKey( @"SOFTWARE\Microsoft\Internet Explorer\Toolbar" ).SetValue( guid, name );<br />
On inspecting the registry after installation I notice that all entries but the last one are in the registry. So whats going on? A manual regasm works for all of the above, an installer based one does not.
|
|
|
|
|
I should reply to my own post. I found the answer to this long ago, but never came back to update this. So here goes. Regasm comes with Visual Studio. So a machine with no visual studio and just the .Net framework will NOT have regasm on it.
Hence, you cannot rely on
[ComRegisterFunctionAttribute]
public static void Register( Type t )
For this is called by regasm. You need to find other ways to register your DLL and make otehr registry entries.
|
|
|
|
|
I have a control that is derived from the standard ComboBox. I want to lock or suppress the DropDown when the arrow button is clicked without disabling the control.
This is related to another post that I have out there for a custom OnPaint event. I want to provide custom colors for ComboBox that work even when the Enabled is set to false (by default it is set to Gray). I have provided a new implementation for the Enabled property to handle it myself. When the control is in my disabled state I am supressing KeyDowns so that it appears as if it is disabled. The only problem is that you can still drop down the list, and choose an item. If I can lock this, I'm good to go.
Oh, and I'd rather not have to use SendMessage in WndProc to accomplish this. I don't want to have a dependency on user32.dll.
--Ian;
|
|
|
|
|
--Ian wrote: I want to lock or suppress the DropDown when the arrow button is clicked without disabling the control.
Sound like a textbox with an image of an arrow next to it.
|
|
|
|
|
I'd also not like to reinvent the wheel. Everything else the ComboBox does is great, I just want to lock the drop down list from being dropped down.
--Ian;
|
|
|
|
|
I guess I don't understand. A dropdown without being able to dropdown is not a dropdown. A rose by any other name would be a textbox.
|
|
|
|
|
The problem is that I need a dropdown with my own custom Enabled property. When I disable it, I want to lock or suppress the dropdown list from being displayed. In other words, this rose must still be a dropdown.
Once again, the root cause for this is that the BackColor is set to Gray when the ComboBox is diabled by setting Enabled = false. The OnPaint event is creating other issues, as expressed in another post, and I'm looking for another workaround.
--Ian;
|
|
|
|
|
Hi CP,
May i know anyone get the things ?
Regards ,
|
|
|
|
|
I have a control that is derived from the standard ComboBox. I have an override for the OnPaint method that paints a border, drop down arrow button, background, and foreground. The only problem is that something (some other event/subcontrol) is drawing a black text box with a large font over top of the text box region of the combo box control.
I am drawing a background in my OnPaint event, and it is being draw on top of. I can see that the background is drawn because there is a border around the text box region. My code looks like the following:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
DrawBorder();
DrawBackground();
DrawArrowButton();
DrawForegroundText();
}
What am I missing here??? By the way, this control works just fine if the DropDownStyle is set to DropDownList, however I'm need it to work as a DropDown (being able to edit the text box).
--Ian;
|
|
|
|
|
--Ian wrote: base.OnPaint(e);
I think you dont need to call that
|
|
|
|
|
Actually it doesn't matter if I call base.OnPaint(e), because I'm doing my custom paint stuff after the call. Either way, if you remove the call, the text box is still drawn by something else.
--Ian;
|
|
|
|
|
The sample class below does not contain all the code, however it will give you an idea of the problem. Just drop this class into your a project, compile, and drop it the ComboDraw control onto a form.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
namespace ComboTest<br />
{<br />
class ComboDraw : ComboBox<br />
{<br />
public ComboDraw()<br />
{<br />
DrawMode = DrawMode.OwnerDrawFixed;<br />
DropDownStyle = ComboBoxStyle.DropDown;<br />
FlatStyle = FlatStyle.Flat;<br />
SetStyle(ControlStyles.UserPaint, true);<br />
}<br />
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
base.OnPaint(e);<br />
<br />
e.Graphics.FillRectangle(new SolidBrush(Color.Green), ClientRectangle);<br />
}<br />
}<br />
}<br />
--Ian;
|
|
|
|
|
Dear friends,
I draw a circle in the client area of the window. Then i divide that circle into four parts by drawing two straight lines passing from the middle of that circle. It means that the circle is divided into four pies.
Now what i want is that whenever i click inside any pie, it should get filled with color. I dont want to fill entire circle with the color. What i want is that whenever i click inside any closed region (like pie), that region get filled with some color. Please tell me how is this possible ?
I want to do some something like famous MS-Paint program. In MS-Paint, we select brush and then click inside any bounded region, as such only that region gets filled with the color.
Imtiaz
|
|
|
|
|
A little bit of research will go a long way.
If you look at the Graphics object you will find methods called FillPie and FillRegion. Perhaps these are what you need.
|
|
|
|
|
Whatever i wrote above is just a simplified form, actually i need to do something like MS paint. If we select brush object in MS paint and click on the drawing, specific portion surrounded by lines or curve gets colored.
Imtiaz
|
|
|
|
|
|
Could give you a cheater (or FillArc). If you want to do it dynamically you may have to do image processing logic. http://www.cs.rit.edu/~icss571/filling/how_to.html
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi,
I need help in avoiding the window which pops up during the USB detection. I am using Windows XP professional and I actually does not want any window to be popped up during this USB Mass storage device or MP3 Player Detection.
Please help me in this issue.
|
|
|
|
|
I have a stored proc in which I want to return a value. This is what I have in my c# code:
private void btnAdd_Click(object sender, System.EventArgs e)<br />
{<br />
strPartNumberInputReference = txtSearchPart.Text;<br />
strDwgNumber = txtDwgNumber.Text;<br />
strDwgRevision = txtDwgRevision.Text;<br />
strDwgLocation = txtDwgLocation.Text;<br />
<br />
ds2 = new DataSet();<br />
SqlParameter param1 = new SqlParameter("@PartNumber", strPartNumberInputReference); <br />
SqlParameter param2 = new SqlParameter("@DwgNumber", strDwgNumber);<br />
SqlParameter param3 = new SqlParameter("@DwgRevision", strDwgRevision);<br />
SqlParameter param4 = new SqlParameter("@DwgLocation", strDwgLocation);<br />
SqlParameter param5 = new SqlParameter("@PartTypeDescription", strPartTypeID);<br />
SqlParameter param6 = new SqlParameter(@ID, 0);<br />
param6.Direction = ParameterDirection.Output;<br />
ds2=SqlHelper.ExecuteDataset(this.connectionString, CommandType.StoredProcedure,"dbo.UpdatePart_Step_1_Test", param1, param5);<br />
dt2 = ds2.Tables[0];<br />
}
My question is on the bolded portions since this is what I just added. I haven't worked with ParameterDirection.Output before. I have (@ID, 0); I put the 0 in there because I saw a response to a similar question on CodeProject. Is this what it really should be? I am returning @ID which is an integer. If I write (@ID, int) the compiler doesn't like it.
Thanks!
|
|
|
|
|
SqlParameter param6 = new SqlParameter(@ID, SqlDbType.Int);
Look at the documentation for SqlParameter, particularly the overloaded constructors
|
|
|
|
|
Thank you, I will do that!
|
|
|
|
|
Although in the case of an ID I must certainly do use them. Don't forget to use SCOPE_IDENTITY in your sp instead of IDENTITY
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Can you elaborate? I'm having trouble with the stored proc. It says it's expecting @ID but not getting it.
CREATE PROCEDURE [dbo].[UpdatePart_Step_1]<br />
@PartNumber varchar (15),<br />
@PartTypeDescription varchar (60),<br />
@ID int OUTPUT<br />
<br />
AS<br />
declare @pt_id integer, @ThePartNumber integer<br />
<br />
if NOT EXISTS (Select * from Parts where PartNumber = @PartNumber)<br />
BEGIN<br />
<br />
SELECT @pt_id = pt.ID FROM PartTypes pt <br />
<br />
INNER JOIN Parts p on pt.ID = p.PartTypeID<br />
<br />
WHERE pt.Description = @PartTypeDescription<br />
<br />
insert into Parts<br />
(PartNumber, PartTypeID)<br />
<br />
VALUES<br />
(<br />
@PartNumber,<br />
@pt_id<br />
)<br />
<br />
<br />
END<br />
SELECT @ID=@@IDENTITY <big>Change this to SELECT @ID = @@SCOPE_IDENTITY?</big>return 0
|
|
|
|
|
Yeah, I use SET @ID = @@SCOPE_IDENTITY. In most cases the two methods are the same. However, if a trigger is called on your insert @@IDENTITY could be changed before your set (or SELECT both are valid)
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|