|
Hi Katalin, I am getting access denied from my network nazis here at work, I will take a look when I get home.
led mike
|
|
|
|
|
Hi Mike,
There shouldn't be a problem with following the link to the two jpgs but since there is, is tere any way I can send them to you by mail?
Regards,
Katalin
|
|
|
|
|
Katalin21 wrote: There shouldn't be a problem with following the link to the two jpgs
It's my company's web proxy blocking my access to that site, not a problem with the links. I got tied up the past two days and couldn't check them out. I should be able to this evening.
led mike
|
|
|
|
|
hi..
hope this question already been posted , but i dont find tat, so tat m asking again. my problem s
i have some forms and reports n my application tat will take some more time to load. so i want to show some loading image or some else at this time . can anybody please help me to sort this , even a link s also prefered.
Thnks n advance..
cheers.
Sam
|
|
|
|
|
If you have some code that will take some time you can look into the BackgroundWorker.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I've created a custom control, and a custom collection. I've also implemented a CollectionEditor so I can add items to the collection at design time.
In the Paint method of my control, I take each item in the collection and paint them much like a ListView in details mode.
My question is this:
When I add a new item to the collection, I need the Paint method to be called. I've found that adding or editing my collection through the CollectionEditor is not causing this to happen. As a reference- if you add an item to a ListView through the CollectionEditor setup for the Items property, you will see that as soon as you edit a property, the listview is updated in Visual Studio's designer. Mine is doing nothing when I edit a value... Does anyone know how the CollectionEditor should notify the control to repaint itself?
I don't think it will help to paste my code here, since this is more of a general question but here is my property with ample opertunity to cause a repaint:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(typeof(AccentListViewItemCollectionEditor), typeof(UITypeEditor))]
[RefreshProperties(RefreshProperties.Repaint)]
public AccentListViewItemCollection Items
{
get { return _Items; }
set
{
_Items = value;
pnlContent.Invalidate();
pnlContent.Update();
this.Invalidate();
this.Update();
}
}
Any advice wold be greatly appreciated! Thanks!
|
|
|
|
|
This article that I wrote: Targeting Design Time Events of UserControls[^] might be able to help you with the Visual Studio Designer.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Unless I've totally overlooked something in your article- I couldn't find a section to help me out with this. I do appreciate the link though.
I think my confusion is that Visual Studio is firing the CollectionEditor code when the property is clicked in the property grid. So if VS has code to tell it when the CollectionEditor should be fired- It seems to me that the code that is firing the CollectionEditor should be responsable for telling the control to refresh. And if that's the case, I don't see how it would be possible for me to code this...
Of course, that must not be the case since the ListView Items property CollectionEditor doesn't behave like this. The ListView control itself is repainted as properties are updated in the CollectionEditor...
So I'm still obviously missing something...
|
|
|
|
|
One thing that I see is that you have a get and set for the collection property. When you add items to a collection you do not use the set part of the property, all alteration is through the get statement. You would have to create an event that will fire when the collection is altered. Ex:ListBox.Items is a collection property that does not have 'set' command (You can see this trough the object browser).
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
YES! You are my new hero!
My custom collection derives from System.Collections.CollectionBase which has a number of protected virtual methods that are fired when the collection is modified. Since the CollectionEditor is modifying the collection, I was able to hook in here.
I created a new delegate and event:
public delegate void OnRepaintControlHandler(object sender, EventArgs e);
public class AccentListViewItemCollection : CollectionBase
{
public event OnRepaintControlHandler RepaintControl;
...
...Created an event handler:
protected virtual void OnRepaintControl(EventArgs e)
{
if (RepaintControl != null)
{
RepaintControl(this, e);
}
}
...And then overrode the events that I needed my control to repaint on:
protected override void OnValidate(object value)
{
base.OnValidate(value);
OnRepaintControl(new EventArgs());
}
protected override void OnSetComplete(int index, object oldValue, object newValue)
{
base.OnSetComplete(index, oldValue, newValue);
OnRepaintControl(new EventArgs());
}
protected override void OnRemoveComplete(int index, object value)
{
base.OnRemoveComplete(index, value);
OnRepaintControl(new EventArgs());
}
protected override void OnInsertComplete(int index, object value)
{
base.OnInsertComplete(index, value);
OnRepaintControl(new EventArgs());
}
Finally, I registered for the event in my control, and invalidated the control on getting the event:
public AccentListView()
{
...
_Items = new AccentListViewItemCollection(this);
_Items.RepaintControl += new OnRepaintControlHandler(_Items_RepaintControl);
...
}
private void _Items_RepaintControl(object sender, EventArgs e)
{
this.Invalidate();
this.Update();
}
Again, thanks for your help- pretty sure I would not have figured this out without it!
|
|
|
|
|
hi,
I have got the .prn file(which is file for printing in driver level)
1.now i want to pick the file from the system/located in the server,
2.then i want to read some tags in that file.
All these tasks should be accompolished using the c#.net
Iam in a phase of high delivery...quick help is appreciated
thanks in advance
|
|
|
|
|
I have a DataGridView that runs hidden in the system tray, and when I unhide it the DataBindingComplete event fires anywhere between 3 and 8 times for the datagridview on the form, drastically slowing down the application. Is there something wrong with the databinding event? MSDN states that changes in the datasource will cause this event to fire. Why is changing the visibility firing it? This is the code for the system tray double click event.
Private Sub sysTray_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles sysTray.MouseDoubleClick
Me.Visible = Not Me.Visible
Me.ShowInTaskbar = Me.Visible
Me.WindowState = FormWindowState.Normal
End Sub
And here is the code in the databindingcomplete event:
Private Sub dgErrors_DataBindingComplete(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles dgErrors.DataBindingComplete
Debug.WriteLine("Fired event: dgErrors_DataBindingComplete: by " + CType(sender, Control).Name + " event Type: " + e.ListChangedType.ToString())
End Sub
The code produces the following output when double clicking on the system tray icon:
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
I dont understand why it is firing 7 times. In fact I don't understand why it is firing at all.
I need another event for the datagrid that fires only once, or I need to fix what is happening here somehow, any suggestions?
Thanx in advance for answers
|
|
|
|
|
bigbrownbeaver wrote: Why is changing the visibility firing it?
I have no idea. Have you looked at the call stack?
led mike
|
|
|
|
|
I just looked there, and I found what is causing it, but I still don't know why... It's the ShowInTaskbar property thats causing this to happen. What puzzles me the most is probably that the property is only changed once, but it triggers the DataBindingComplete event 7 times.
I have commented out that line until I have some free time figure out what exactly is casuing it, for now people are just going to have to live with the application in their system tray.
Thanks for the help mike.
|
|
|
|
|
I have a textbox called "textBox6.text" in a C# Windows Application in Visual Studio, and i want that the text entered by the user in the textbox should be added to the "PURPOSE" field in a table "TABLE2_HDB1" in Oracle database "HDB1" on clicking a "submit" button.
the coding for submit button is as follows:-
private void button1_Click(object sender, EventArgs e)
{
string OracleStmt;
string ConString;
OleDbConnection cn = null;
OleDbCommand cmd = null;
try
{
OracleStmt = "insert into TABLE2_HDB1(PURPOSE) values(@PURPOSE)";
ConString = " Provider=MSDAORA;Data Source=HDb1;User Id=SYSTEM
;Password=*****;";
cn = new OleDbConnection(ConString);
cmd = new OleDbCommand(OracleStmt, cn);
cmd.Parameters.Add(new OleDbParameter("@PURPOSE", OleDbType.VarChar , 20));
cmd.Parameters["@PURPOSE"].Value = textBox6.Text;
cn.Open();
cmd.ExecuteNonQuery();
textBox8 .Text = "record inserted successfully";
}
catch (Exception ex)
{
textBox8 .Text = ex.Message;
}
finally
{
cn.Close();
}
}
on executing this code u get the error :-
ORA-00936:missing expression
plz. help
|
|
|
|
|
My Problem is when I debug my application I am getting broadcast messages from sever but not getting these broadcast when not in debugging mode.
portion of the code iss
do
{
byte[] myReadBuffer = new byte[tcpClient.ReceiveBufferSize];
int numberOfBytesRead = 0;
try
{
if ( networkStream.CanRead)
numberOfBytesRead = networkStream.Read(myReadBuffer, 0, myReadBuffer.Length);
}
catch (IOException)
{
networkStream = tcpClient.GetStream();
}
if (numberOfBytesRead!=0)
myCompleteMessage += System.Text.Encoding.ASCII.GetString(myReadBuffer,0,numberOfBytesRead);
}
while(networkStream.DataAvailable);
if (myCompleteMessage.Length!=0)
{
DeliverMessage(myCompleteMessage,"","","","");
RegisterCompletion();
myCompleteMessage="";
}
Close();
return true;
|
|
|
|
|
Hi friends,
I have 2 list box and a horizontal Splitter. When I resize the window, both the listbox does not resize proportionally. The top listbox remains in same height, the bottom listbox gets resized.
The properties for splitter is
cursor - HSplit
Dock - Top
The properties for listbox1 is
Dock - Top
Anchor - Top,Left
The properties for listbox2 is
Dock - Fill
Anchor - Top,Left
I tried changing the dock properties. It does not help me.
Please help me.
Thanks,
Thiaga
|
|
|
|
|
Hi Thiaga,
In order to get the desired resolution try setting the Dock property of first ListBox to Fill. This will ensure that the ListBox resizes proportionally to the window. Since the Dock property is set to Top, the width will resize in proportion to the window size.
Hope this helps.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi,
I tried that option too. If the dock property of both the list box is set to FILL.
I can view only one listbox.
|
|
|
|
|
This is solved by using split container instead of splitter.
Thanks..
|
|
|
|
|
Use TableLayout, make 2 rows (1 column) and set the row height to 50% each. Dump the listboxes in each row.
Another way is to calculate the position of the splitter when the form size changes.
|
|
|
|
|
Do not cross post[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I would like to know how one can install skins into applications built using Microst visual studio .NET 2005. Im currently coding using C#.NET. i've downloaded skin crager3 and skin engine but cant seem to get them to work.
Please help. are there any other simple rograms that can create skins and let me apply them to my applications?
Thanks.
|
|
|
|
|
One way to customize the appearance of an application is to override the toolstrip renderers. One of my articles might be able to help you with that: Custom ToolStrip Renderers[^]. However, if you want to go beyond that customization you will either have to buy a control suite with a skin engine or create your own skinning framework.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I want the "label" for my checkbox (i.e. the text that you can click to check/uncheck the box) to have a link in it. My current solution is to put the empty string in the Text property of the checkbox, then just place a LinkLabel next to the checkbox where the "label" (i.e. Text ) would normally be.
This doesn't work very well because clicking on the (non-hyperlinked parts of the) linklabel doesn't check/uncheck the checkbox. I suppose I could hack it with a Click event handler, but it seems like there must be a better way... I'm just not seeing it.
Any ideas?
Thanks!
-Domenic Denicola-
|
|
|
|