LinkArea not Deserializable
Create a form, drop a LinkLabel on it, and set the form's Localizable
property to True in the designer. If you run this with full trust, everything
works. Run it without full trust (by going to the command line and running
\\localhost\...\program.exe) and you will get the following exception:
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord
pr)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at System.Resources.ResourceReader.LoadObject(Int32 pos)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean
ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo
culture)
at System.Resources.ResourceManager.GetObject(String name)
at
Clientele.Utility.DbHealthChecker.ConfigurationSettingForm.InitializeComponent()
at Clientele.Utility.DbHealthChecker.ConfigurationSettingForm..ctor()
at Clientele.Utility.DbHealthChecker.MdiMainForm.MdiMainForm_Load(Object
sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Basically, this stops us from using a LinkLabel when our forms are
localizable and the EXE isn't run with full trust. Tag: Default file type handlers Tag: 78965
DataGrid cell double click event
How can I know every time a user made a double click in a cell of my dataGrid?? Tag: Default file type handlers Tag: 78963
WS_EX_LAYERED/LockWindowUpdate problem
Hello,
I use LockWindowUpdate() API function through P/invoke to prevent updating
form content while updating/removing/adding something in form (child
controls). Despite of the bug in W2k (Q270624, Layered Windows Disappear
During Calls to the LockWindowUpdate() Function) I do something like this:
1. Remove WS_EX_LAYERED attribute from form through SetWindowLong API
2. Call LockWindowUpdate
3. some updates (adding/removing child controls through standard .NET methods)
4. Call LockWindowUpdate - for form unlock
5. set back WS_EX_LAYERED flag on a form
6. redraw form
but on W2k after a point 5 form disappears and I cannot resolve this issue.
Thanks in advance
-bda- Tag: Default file type handlers Tag: 78960
drawing text, autosizing textbox, flickering ...
Hi (VS.Net 2003 + SP),
how to make anchored textboxes, toolbars or statusbar not to flicker on
resize?
And one more thing, I wanted to make multiline textbox to autosize in height
and width. Since autosizing is done only in singleline, I used
prefferedSize= Graphics.MeasureString(control.text, control.font)
to get required size. But after resizing textbox, I saw that it is too wide
and height is less than required. So I tried to paint text myself. Then I
saw, that everyline of that text is painted differently (using standart font,
same text on every line), changing text to Arial 9pt, helped a bit. But
anyway it is too wide and height is less than required for textbox. How to
implement full autosizing for textbox? Tag: Default file type handlers Tag: 78951
Status images in DataGrid
Hello,
is there any way how to use first column (RowHeader) to display custom
images (e.g. status icons)?
Thanks a lot
Vladimir Tag: Default file type handlers Tag: 78946
Display deleted rows in DataGrid
Hello,
I use DataGrid that displays data from DataTable. When I delete a row, this
row disapears in DataGrid and changes it's status in DataTable.
I there any way how to display everything what's in DataTable?
I want that user will see all changes made and after clicking some "Commit"
button those changes will be saved into the database.
Thanks a lot
Vladimir Tag: Default file type handlers Tag: 78944
using F7 as shortcort doesn't work?
Hi,
I am having trouoble using the F-kesy as shortcuts.
The shortcut is defines like this (c#):
btnRun.Shortcut = Shortcut.F7;
I have provided the button with a valid eventhandler that works just fine
when pressing the button, but pressing the F7 key doesn't trigger anything
at all.
All my other shortcuts that doesn't use F-keys are defined in the same and
they work just fine.
Has anyone experinced the same problems and maybe found a solution?
Thank you.
Torben Tag: Default file type handlers Tag: 78943
DataGrid - reduce flicker-free
hi,
How to make datagrid flicker-free? I have tried to set ContorlStyle double
buffering options, but seems not working well.
thanks Tag: Default file type handlers Tag: 78938
Unable to keep form on top
I'm trying to create a screensaver using managed directx, but the same
happens with the wizard generated screensaver project in VC# 2005. Any
window set to "always on top" is not getting obscured, like the standard
windows screensavers can.
I've tried setting the presentparams for the device constructor to
"windowed=false".
I've set the form property Toplevel=true, topmost=true, and called
.bringtofront().
Anybody know what I'm missing? Tag: Default file type handlers Tag: 78934
Controls created on one thread cannot be parented to a control on a different thread
I am trying to make a window that pops up, to show that my application
is busy. I want it to be able to be called from anywhere, any thread,
so I put it as a static method in a class.
Code listed below.
The problem is, no matter what I can think of doing, I get the
following exception:
"Controls created on one thread cannot be parented to a control on a
different thread"
Trace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller,
Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[]
args)
at UI.Waiter.Busy(Object waitOn)
or i used to get this with a slightly different configuration (same
exception):
Trace:
at System.Windows.Forms.ControlCollection.Add(Control value)
at System.Windows.Forms.ControlCollection.Add(Control value)
at UI.Controls.WaitForm.InitializeComponent()
at UI.Controls.WaitForm..ctor()
at UI.Waiter..cctor()
Anyone got any ideas... or am i going about it the wrong way all
together!?
Cheers
Greg
----- CODE -----
using System;
using System.Collections;
using System.Threading;
using System.Windows.Forms;
namespace UI
{
/// <summary>
/// Summary description for Waiter.
/// </summary>
public sealed class Waiter
{
private static ArrayList _list = new ArrayList();
private static Mutex _lock = new Mutex();
private static Controls.WaitForm _form = null;
private static Form _parent = null;
public static Form Parent { get { return _parent; } set { _parent =
value; } }
private Waiter()
{
}
private delegate void BusyDelegate( object obj );
public static void Busy( object waitOn )
{
if( _parent != null )
_parent.Invoke( new BusyDelegate( InternalBusy ), new object[] {
waitOn } );
}
private static void InternalBusy( object waitOn )
{
// this has to be done here for threading reasons
if( _form == null )
_form = new Controls.WaitForm();
// show the waiting form
_lock.WaitOne();
try
{
_list.Add( waitOn );
if( _list.Count == 1 )
{
_form.Restart();
_form.Show();
System.Windows.Forms.Application.DoEvents();
}
}
finally
{
_lock.ReleaseMutex();
}
}
public static void Ready( object waitOn )
{
_lock.WaitOne();
try
{
_list.Remove( waitOn );
if( _list.Count == 0 )
{
_form.Hide();
}
}
finally
{
_lock.ReleaseMutex();
}
}
}
} Tag: Default file type handlers Tag: 78931
embedded powerpoint diasshow
Does anyone know how to embed a powerpoint presentation in a windows forms
applikation. I can't find any documentation on how to do this anywhere. Seems
there isn't an Active-X control for viewing powerpoint presentations from
within another application.
Regards
Ole Inselmann Tag: Default file type handlers Tag: 78920
Problem using SHBrowseForFolder
I am using VS 2003, .net 1.1
I am trying to use the SHBrowseForFolder dialog, as wrapped up in a
component from CodeProject (I don't have the URL handy).
The dialog appears, but the treeview does not.
I get the same result using the old .net 1.0 method with
FolderNameEditor and FolderBrowser(). It used to work before I
upgraded to 1.1 .
Any suggestions?
TIA,
Art Tag: Default file type handlers Tag: 78918
fileacces problems
Hi,
I'm in the middle of developing a c# project.
When I run my application from VS.net it's run from the projects bin\debug
library.
My problem is, that when closing the application I am writing a xml file
containing some settings to this library, but I get an "Access denied
error". I am experiencing this error because the debug folder is marked as
"read only".
It doesn't matter if I uncheck the "read only" checkbox, because everytime
my project is compiled, it is set again.
How do I change this, and why is the acces to this folder restricted to
"read only"?
Thank you.
Best regards
Torben Tag: Default file type handlers Tag: 78915
How to make a UI which resembles the VS.NET 2003 IDE UI
Hello!
The VS.NET 2003 user interface has very nice details. The small areas which
look like windows and which may slide away if you don't need them for the
moment.
Can't some of you illustrate a bit how such details may be built?
Best regards,
Henrik Dahl Tag: Default file type handlers Tag: 78913
Autocomplete combobox
For all of you who are searching for auto complete functionality in
.net combobox. I wrote this code yesterday after being unable to find
something usable and workable on the internet. All examples that I've
tried either bulky and simply not elegant and inefficient or does not
work properly. Maybe I was just not lucky and patient enough to try
more examples :) instead I wrote my own code. Hope it helps someone. I
appreciate all comments and bugs in the following code being posted
back to the group.
Regards,
Michael Shapiro
P.S. call this sub from KeyUp event of the combobox
Public Sub AutoComplete(ByVal cbo As
System.Windows.Forms.ComboBox, ByVal e As
System.Windows.Forms.KeyEventArgs)
Dim index As Integer
Dim p As Integer
Select Case e.KeyCode
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Down,
Keys.Delete, Keys.Tab
Return
End Select
p = cbo.SelectionStart
index = cbo.FindString(cbo.Text.Substring(0, p))
If index = -1 Then Return
cbo.SelectedIndex = index
cbo.SelectionStart = p
cbo.SelectionLength = cbo.Text.Length
End Sub Tag: Default file type handlers Tag: 78911
Docked panels and Z-order problem.
Hallo=2E
I have two panels docked on the right of the form (p1 on the left=
and p2 on the right) and I want third panel to slide from right=
to left into a view between p1 and p2 (Just like Solution=
Explorer window in Visual Studio ? if it is in auto hide mode=
its slides to left when mouse is over it), but when I put my=
third panel on Controls list of the form, set it child index=
between those two and start to slide I have opposite effect ?=
the p1 is visible and p2 is hidden ? it is a way to do this=
right ???
--------------------------------
From: Dominik Jeske
-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>yW8wOI8ZAk6AmAd7vIZBcg=3D=3D</Id> Tag: Default file type handlers Tag: 78906
Problem with Z-ordering !!!
Hallo !!
I have two panels docked on the right of the Form (z order index=
p1: 0, p2: 1) and I want to third panel slide from the right=
between those two panels (just like in Visual studio when you=
put mouse over autohided SolutionExplorer its slides to view)=
but because of z-ordering when I put my control on the form and=
set his ChildIndex between those two I have opposite effect ? p2=
is hided and p1 is visible ? any idea how to do this right ?=
?????????
--------------------------------
From: Dominik Jeske
-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>VZCLNlkgMEinfTjACsJSzg=3D=3D</Id> Tag: Default file type handlers Tag: 78905
Form transparency issues
Recently I wanted to create a small little program that could sit=
on the desktop and not block the desktop wallpaper=2E There are=
two methods to accomplish this ( that I am aware of )=2E
1) create a solid color bmp as a background image and set the=
transparency key to match its color
2) specify the form's background color with a matching=
transparency key
Now my issues with both methods, but first it should be known=
that I have set the forms to have no border or title bar and=
have implemented code that allows me to click-and-hold anywhere=
( with exceptions listed below ) on the form and move it=2E The=
data actually displayed on the form is just text and one=
rectangle, all drawn by me ( there are no controls on the form=
itself )=2E
1) I have two issues with this method, although it is what I'm=
prefering to use at the moment=2E The first seems to be the=
discrepancy between how the program is handled when the=
computer's Color Depth is 32bit or when it is less than 32bit (=
16bit )=2E When the color depth is 32bit then I am able to click=
on the entire area the form inhabits ( even that which is=
transparent ) and move it, but if the color depth is less than=
32bit ( 16bit ) then only the drawn text or rectangle outline (=
since it has no fill ) can be clicked to drag the program=
around=2E Clicking on the transparent areas just passes the click=
through the form to whatever is below ( even when I know the=
form has focus )=2E I'd like to be able, regardless of the=
desktop's color depth, to click anywhere within the form area=
and move the application=2E
The second issue I have with this method occurs when I take my=
executable and put it on another PC ( my PC is XP Pro, the other=
PC is XP Home=2E=2E Both SP2 )=2E The problem is similar, but a=
little different=2E When the 2nd PC's color depth is at 32bit,=
the transparency does not work=2E The green/lime ( that's the=
transparent color I'm using ) background shows=2E Needless to say=
this is not acceptable=2E When I change the color depth to less=
than 32bit ( 24bit this time ), the transparency actually works,=
but I come across the same issue of clicks on the transparent=
areas just passing through=2E
2) With this method I have not tried it on a 2nd PC yet ( I don't=
have it available where I am atm )=2E Its basically the same=
"issue" as mentioned above with color depth less than 32bit,=
except it does it with a color depth of 32bit and 16bit=2E Clicks=
on the transparent areas just pass right through=2E I'm tempted=
to just go with this method and possibly make one area on the=
form that is meant to be used to drag it around ( similar to the=
idea of the box that appears to move tables in MS Word ), but=
I'm hoping there's a solution I'm unaware of before I do that=2E
Anyways, all of this brings up some interesting questions=2E
-What does color depth have to do with transparency handling?
-Does the version of XP ( Home or Pro ) handle transparency=
differently?
Probably some more questions also=2E
Not sure if it matters, but I'm doing all of this in C#=2E
So any ideas to get pass any of these issues?
Thanks in advance=2E
--------------------------------
From: othell m=2E
-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>8xrsHvZKNkGRSJumCntIww=3D=3D</Id> Tag: Default file type handlers Tag: 78904
Odd closing problem
I have a base form with a Cancel button (btnCancel) and a simple msgbox
routine. I would like to have a routine closing check to prevent loss of
data.
Dim i As Integer
i = MsgBox("Exit?", MsgBoxStyle.YesNo + MsgBoxStyle.Question)
If i = MsgBoxResult.Yes Then
Me.DialogResult = DialogResult.Abort
Me.Dispose()
End If
I have another form that inherits from the base form. In both parent and
decendent the Cancel button property of the form is set to (None).
The problem is this. Even given the above, even given that I've traced the
code and can see that the Me.dispose call is NOT being made when I click No,
the form still closes. Any suggestions as to what I might be overlooking? Tag: Default file type handlers Tag: 78900
Formatting txtPhone
I have a txtPhone that I need to format like 555-555-5555 and when a user
inputs numbers it should only take numbers. Tag: Default file type handlers Tag: 78899
strange problem with binding collection object to listbox control
I have a business object with two public properties - "OrganizationID" and
"OrganizationName". Pretty typical. We will call it Organization.
And I have a collection object which is an arraylist that stores a
collection of the business object described above. Let's call it
Organizations
I have a lstbox control. So I bind it Organizations to the listbox control.
lstSelectedOrgs.DataSource = null;
lstSelectedOrgs.ValueMember = "OrganizationID";
lstSelectedOrgs.DisplayMember = "OrganizationName";
lstSelectedOrgs.DataSource = Organizations;
I initially populate the control. Then I have a way to remove an item. And
then I bind it again.
At some point, all of a sudden, what shows up in the list box looks like
this.
MyNameSpace.Organization Tag: Default file type handlers Tag: 78895
how do I set the version information?
How do I set the version of my app? I can do this in the setup app, but it
does not coincide with the actual application.
-Max Tag: Default file type handlers Tag: 78894
Beta Readers Wanted - Whidbey C# - (O'Reilly Author)
This is a one time request for beta-readers for a new book I'm working on.
*************
I'm writing a new book on Visual C# 2.0 - target audience is C# 1.x
programmers looking to move up to 2.0 (code-name Whidbey).
The ideal candidates have been programming in Visual C# 1.x for a while, are
familiar with and comfortable with all the language fundamentals, delegates,
creating windows and web applications and so forth and are ready to learn
what is new in Visual Studio and C# 2.0, as well as highlights of what is
new in creating Windows and Web Applications.
I will post the chapters after I've written them but before they've been
edited or tech-reviewed. Your job will be to provide guidance and advice as
to how helpful the chapter is, what is missing, what could be clearer, etc.
You can expect to read (and respond to) about 40-50 pages per week through
Thanksgiving; starting next week. Ideally, you'll have the Visual Studio
2.0 Beta installed on a computer and will be able to try the exercises,
though this is not strictly required.
There is no financial compensation (though active participants will receive
a copy of the book when it is published, and an acknowledgement in the book
itself). You will need to sign a Non-disclosure agreement and you'll need to
join a forum on Delphi (membership is free).
If you are interested, please send me email (jliberty@LibertyAssociates.com)
with your name, email, C# experience, etc.
Thank you.
Jesse Liberty
Author:
Programming C#
Programming Visual Basic .NET
Programming ASP .NET
Programming Windows .NET Applications
Numerous other books
http://www.LibertyAssociates.com Tag: Default file type handlers Tag: 78893
Logic Help
I need some help with user names and passwords (five users and one password
for each user). I have two txtboxes (txtName, txtPassword). If a user
clicks enter and both are empty then a message is displayed, "enter user
name." If just the name is entered the message "enter password." If wrong
name and right password then message "re-enter name." If right name and
wrong password message "valid name, wrong password." I cant figure this out,
can someone help me please? The names are tied to a passwords, for example a
user might have 123 for a name and a password of 456 Tag: Default file type handlers Tag: 78879
Make checkbox larger
Who knows how to make the actual check box rectangle larger? Is the onlyway
to inherit from checkbox and override its paint method or something?
thanks Tag: Default file type handlers Tag: 78865
Using designer without Forms
My program consist of different panel that I load and unload on a
form. I would like to be able to user the Form designer directly on a
panel without using a form since this panel will be put on a form at
run time. Any ideas? Tag: Default file type handlers Tag: 78864
scrolling a user control
Hi,
I have created a user control which I then add standard controls to
prgramatically i.e. picture box, text box etc.
I'm just wondering if it is possible to scroll to given position in the
scrollable region? So lets say the control has a height of 300 pixels and the
scrollable height is 1000 pixels then I'd like to be able to just make pixel
500 appear in the top left of the controls visible area.
If this isn't possible what alternatives are there for scrolling a user
control programatically.
Many thanks in advance for any answers.
Best Regards,
Steve. Tag: Default file type handlers Tag: 78861
Icon in tray with Windows Service
How can i get an icon in the tray to allow for service
control/configuration? I have tried allow service to interact, but it
didn't work like i wanted, i could see the icon but i couldnt do anything
with the context menu.
TIA. Tag: Default file type handlers Tag: 78856
Error: Specified Cast is invalid
Hello:
Hope you can help me.
Below is the code in Windows Forms VB to Export
the "Notifications.rpt" Crystal reports to PDF. This
report is connected to a dataset.
The oRptNOTE.Export() line is failing. I am not sure
why.
Dim oRptNOTE As Notifications
oRptNOTE = New Notifications
oRptNOTE.SetDataSource(Dataset12.notification)
Dim DiskOpts As
CrystalDecisions.Shared.DiskFileDestinationOptions = New
CrystalDecisions.Shared.DiskFileDestinationOptions
oRptNOTE.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
oRptNOTE.ExportOptions.ExportFormatType =
CrystalDecisions.
[Shared].ExportFormatType.PortableDocFormat
DiskOpts.DiskFileName = "c:\temp\test2.pdf"
oRptNOTE.ExportOptions.DestinationOptions =
DiskOpts
oRptNOTE.Export() Tag: Default file type handlers Tag: 78853
Client side controls in IE not working as expected
I am developing a windows forms user control that will be hosted within IE
from a web page.
For testing purposes and on the client machine, I changed the .NET Framework
security policy to give full access for the site that has the control. After
all this, IE shows the control fine without problems.
The problem happens when the control is signed with public private keys
pair, IE doesn't show the control but shows an empty box instead (like an
image link is missing or something)..
This is the HTML code i am using to host the control:
<OBJECT id="HelloWorldControl1" height="500" width="500"
classid="NetAppletCtrl.dll#NetAppletCtrl.HelloWorldControl" VIEWASTEXT>
</OBJECT>
Any comments why IE doens't show the control when it's signed. Do I have to
specify the strong name?
I tried a lot and couldn't figure out how.. Maybe it's a bug in IE!!
Thanks, Tag: Default file type handlers Tag: 78851
mshtml and windows services
I have an application that uses the Ax web browser object. When I call the
IHTMLElement.click() method on an input button (<input type="submit"> or
<input type="button">), the click fires appropriately, if I'm running it
from a windows forms based application.
However, when I run the EXACT same code under a windows service, either as a
logged in user or as the local system account, the click fails to process.
Clicking on other elements (like <a>) works.
I've tried submitting the form directly, in cases where a submit occurs, but
can't do that either. Both GET and POST actions fail.
What am I doing wrong? Is there something that prohibits the onclick event
from firing for buttons when running as a service? Am I missing something?
Robert Tag: Default file type handlers Tag: 78849
Windows Form And Windows Service
Hello
Can we invoke any windows from from windows service on specific time
reach?
Thanks in Advance Tag: Default file type handlers Tag: 78848
C# Windows App - SecurityException
Hello,
I created a very simple C# application that does nothing more than starts an
IE session and points to a specific site. Works great on my LocalMachine or
anyone's localmachine.
However, when we attempt to run it from the network we get a
System.Security.SecurityException error. From some searching that I have
done I needed to create a StrongName for it. I did and referenced it in my
AssemblyInfo.cs file, gave it a build version and recompiled. That doesn't
seem to do anything differently.
I am wondering what to do, step by step instructions in how to get an .exe
file to run from a network?
TIA,
Kevin Tag: Default file type handlers Tag: 78844
No Touch Deployment and querystring parameters
Let me start off by saying that I have read the Chris Sells article on MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms05152003.asp).
I am trying to implement it on my project. I have copied his
ConfigFileHandler class and tried to use it in my project but I keep getting
the "An exception â??System.IO.FileLoadExceptionâ?? has occurred in IEExec.exe"
error. I also read about the need for the Last-Modified header. I can not
get it to work and I am not sure how to debug to try to get a better
understanding of the problem. Any one have any ideas on a solution? Tag: Default file type handlers Tag: 78843
How to show a modal dialog from a different thread
Hi,
I have the following classical situation;
1)A long operation needs to be done in my application( that has many windows )
2)A progress dialog must be shown in a separate thread
3)The long operation continues in the program main thread.
The problem is,
from the second thread I call ShowDialog(), but this dialog will not be
Modal!!!
Obviously .net modal dialog will only work if all dialogs in the application
are opened in same thread.
in my scenario I can simply switch between two dialogs( the progress dialog
and the backgroud dialog)
How can I show a dialog that is modal to all other dialogs even if the
application dialogs were opened in different threads?
Regards,
Faris Tag: Default file type handlers Tag: 78833
Crystal Report table fields change when reviewed.
I have a crystal report, using a typed dataset. I click my button to view the
report, it's at this point I have a break point. I look at the table fields,
and they are wrong.
But, if I click my view button a second time, without restarting the app,
the fields are correct.
Where am I getting my wrong fields from. Tag: Default file type handlers Tag: 78828
Get currently selected row in datagrid?
I have a datagrid bound to a dataview. How do I get the currently selected
row programmatically so I can retrieve my primary key? Tag: Default file type handlers Tag: 78824
ImageLists on localized forms
Hi.
When setting Form.Localizable = True in Visual Studio, any ImageList on the
form is copied/serialized into the resources for each language. This
behavior is really annoying, since I only want to have _one_ copy of the
icons (the same icons for all languages). Right now I have to either
manually update the icons for each language or remove the serialized
ImageList from the resx files. Another problem is that the application is
getting "bloated" because of the multiple copies of the same icons. Is there
any way to avoid this behavior? I already have implemented a customized
LocalizationFilter (
http://windowsforms.net/articles/localizationfilter.aspx ), but the Windows
Forms designer seems to ignore it when checking if the ImageLists should be
serialized.
Regards,
Gerrit Tag: Default file type handlers Tag: 78822
Datagrid looks different in design view to runtime?
I've built a datagrid in the form design view and specified column widths in
the DataGridTableStyle collection editor. It looks fine in design view, but
when I run my app all my columns are the same width. How could this be?
Regards,
Chris Tag: Default file type handlers Tag: 78820
Urgent Help on converting vb6 chr$() to C#
Dear all,
I'm using VB6 need to convert to C# for printing. In VB6 I will send some
printer command into the printer as below:-
Printer.Print "TESTING LINE 1"
Printer.Print "TESTING LINE 2"
Printer.Print Chr$(&H1C); "(L"; Chr$(66); Chr$(49);
Printer.Print Chr$(&H1D); "V"; Chr$(49);
Printer.Print Chr$(&H1C); "(L"; Chr$(67); Chr$(50);
In C# I'm writing a text file and open LPT1 to print some lines, the problem
is how to convert those VB6 codes into C# ?
I've try using some sample code as below :-
writer.WriteLine ("TESTING LINE 1" + ((char) 13));
writer.WriteLine ("TESTING LINE 2" + ((char) 13));
writer.WriteLine( ((char)&H1C) + "(L" + ((char)66) + ((char)49));
But there are errors on the above codes. Please provide solutions and
examples.
Thanks in advance
Cheers,
Mae Tag: Default file type handlers Tag: 78814
Datagrid - GridLineStyle
Hi,
I have a requirement to show only vertical lines in the datagrid, is there
any way we can do this.
Thanks
Bala Tag: Default file type handlers Tag: 78811
background images sooo slow
Hi all,
I'm working on an application and want to use background images for forms
and controls. Using the images itself is not a problem, but when I run my
application it becomes really slow and my CPU usage goes up to 100% for a
time...
Is there a better way of setting background images?
It's just 3 images I think, all pretty small, and I already created the
objects for the images and set them to the controls at runtime so that it
uses only 3 objects and not new instances for every control.
But still...
It can't be that hard just to show a couple of images...?
Many thanks for your help...
Andreas Tag: Default file type handlers Tag: 78810
Richtext SelectedText Selectionstart
I have a very ODD situation.
I have a RichTextBox and a button. In the button click event I have the
following:
me.richtextbox1.SelectedText="test"
Assuming I start with "aaaabbbbcccc" in the richtext box and I place the
caret between the a and b and hit the button. I get "aaaatestbbbbcccc" as
expected. Then I click between the b and the c and hit the button I get:
"testaaaatestbbbbcccc".
I added some watches on richtextbox1.SelectionStart and find that the first
time it is 5 as expected. But on the second button press it is zero! Also
the SelectionLength is zero on the second press even if I set the cursor
between the b and c and drag across the first three of the c's.
This all occurs in my actual application, so I created a simple form with
only these two elements and it works fine. So obviously something else is
interfering with this operation in my real application. I am at a loss as
to what!
In the real app the richtextbox is bound to a dataset, but I can't see why
that should cause this behavior. I don't see any other events firing that
might somehow screw up the SelectionStart like this. The Richtextbox is on
a tabpage (and so is the button), but again I see no reason why that should
have an effect.
Anybody else ever struggle with this?
Gary Tag: Default file type handlers Tag: 78809
simple binding of controls to object properties - refresh controls
I have a dialog with controls bound to class properties, e.g. :
numericUpDownPort.DataBindings.Add("Value", localOptions, "Port");
textBoxDatabaseName.DataBindings.Add("Text", localOptions, "DatabaseName");
textBoxDataUsername.DataBindings.Add("Text", localOptions, "DataUsername");
- i.e. localOptions (a member of the form) is a instance of a class with
properties DatabaseName, Port etc.
My problem is that when the underlying object is refreshed (user can load
the class from a file), the controls don't update. The object's properties
are now different from the user interface.
How to I force the controls to reload their data from the object?
I thought Push/PullData() might be my new friends but these are protected
methods.
Thanks for the help,
Rua HM.
This is a kindoff-followup to "control data binding not happening when data
entered from app"
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.framework.windowsforms&tid=8b0951c9-07b2-4c65-b891-baea7036ece5&cat=en-us-msdn&lang=en&cr=US&sloc=en-us&m=1&p=1 Tag: Default file type handlers Tag: 78800
Change Windows Class Name
Is there a way to override the forms default window class name ..
(WindowsForms10.Window.8.....) ?
I tried to override CreateParams but got an exception
System.ComponentModel.Win32Exception "Invalid window class name"
Can someone please help as my app needs to be located by a c++ app
which is using FindWindow() method.
Any help will be greatly appreciated... Tag: Default file type handlers Tag: 78799
ComboBoxes and the sorted property
Discovered a fun one that I thought I should share, and hopefully catch
Microsoft's attention to update some documentation.
I'm a bit new to VB.NET, and was struggling with getting a combo box to
work. I was attempting to take advantage of the cool way to load a combo box
via a datasource, rather than the old VB6 way of adding selections.
First I tried an array of objects. I had some issues with that that I
suspect had a lot to do with not overloading ToString on the class so the
combo box would return the right thing for the displaymember item. But I had
also read some bugs around arrays and combo boxes, so I switched to a
disconnected dataset.
I had a heck of a time getting the combo box to load properly. I kept
getting either no data in the combo box, or it kept showing the phrase
"System.Data.DataRowView". I found out that you have to set the datasource
property first, before you set the datamember and the valuemember properties.
But the real kicker was that you can't use the datasource and get it to work
if the sorted property on the combo box is set to true. It appears that if
you set that property to true, then the combo box assumes you're going to do
things the old VB6 way and use the Add items method to the combo box. My
tipoff something was wrong that I'd watch the debugger, and right after the
statement like this:
cbTest.DataSource = dsInfo.Tables(0)
the value of cbTest.Datasource was "nothing", like the assignment didnt take.
In order to get things to work the way I wanted them to, I simply built a
dataview that sorted the table for me, and fed that to the combobox with the
sorted value off, and it finally worked. Three weeks later, of course.
Would someone from Microsoft confirm that you shouldn't use datasource in
combo and list boxes if you set the Sorted property to true in the form
designer? If that is the case, note that somewhere in the MSDN information
about the ListBox and the ComboBox classes!! It's not mentioned in the
MSPress books either (I have Programming Microsoft Visual Basic.Net, the 2003
version, ISBN 0-7356-2059-8) Tag: Default file type handlers Tag: 78798
DataGrid
I need help in a bad way. I have a form with a datagrid in it coming for a
Access DB. I have 3 columns, StudentName, Address, Phone. I am using
Me.bindingcontext(School11, "Student") to bind buttons like first, next ect...
I have a button Add/Edit and Update to Disk and Insert
I have no idea how to code this so I can add a record to the above table.
Can someone please help me! Tag: Default file type handlers Tag: 78797
Accessing Files via HttpWebRequest from Virtual Directory in IIS 6
I have a virtual directory setup in my web service.
...47.169/webservice1/myvirtual/table1/image/
I can browse to my image directory and see the 100 or so compressed binary
image files that reside there. The problem is that nothing I do will allow
me to
access the individual files that reside in the image directory. I keep
getting
The page cannot be found
The page you are looking for might have been removed, had it name changed or
is temporarily unavailable.
That is what I get when I just double click on one of my files. when I try
to access via a webrequest from my client application, I get a 404 error.
Any suggestions:
Fred Tag: Default file type handlers Tag: 78796
Strangeness in OnPaint
Hi,
In windows forms (vb.net), i use my own controls subclassed from base
controls and i override the Onxxx methods.
for example:
Public Class MyBouton
Inherits System.Windows.Forms.Button
.
Protected Overrides Sub OnPaint(ByVal pe As
System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(pe)
.
Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
Mybase.OnClick(e)
.
I saw that :
- for some controls (ex: combobox), i can't access to OnPaint but i can
access to OnClick ..
- for these controls, if i had in the constructor :
Me.SetStyle(ControlStyles.UserPaint, true)
i can now access to OnPaint (then i must draw the control even if i put
MyBase.OnPaint(pe))
but if i put : Me.SetStyle(ControlStyles.UserPaint, false)
i can't access to none Onxxx
- in some controls (ex: Button) without Me.SetStyle, it is ok, i can
access to OnPaint
I saw also if i intercept a windows message, it is ok :
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
Select Case m.Msg
Case &HF ' =15 =Paint
Can anybody explain this strangeness ?
Is it a known bug ?
Is it better to use always windows message instead of OnPaint ?
Thanks for advice.
Dominique Gratpain
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Default file type handlers Tag: 78795
Event log is full
I have an app that catches errors with Try Catch blocks as
follows:
Catch ex As Exception
Dim Event1 As New EventLog
Event1.Log = "Application"
Event1.Source = "QuickCheck"
Event1.WriteEntry("Error in PlayBalance_EnterEvent. Message
is: " & Chr(13) & ex.ToString)
End Try
In doing so, when the event log gets full, I get an unhandled exception
stating the event log is full. It seems I need a global try catch to
handle this. Can this be done? Is this the best way to handle?
YBraker
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Default file type handlers Tag: 78794
Is there a way to get the path to the application that is the default
handler for a given file type w/o having to manually crawl around the
registry?
"Brad" <bradley_.wood_@ndsu_.nodak_.edu> schrieb:
> Is there a way to get the path to the application that is the default
> handler for a given file type w/o having to manually crawl around the
> registry?