Where is 'TooltiipText'?
in VB6 - if I had a textbox that included text which was longer than the
actual box - I could easily, as the box was populated, add something like:
txtOne.ToolTipText=(same as text)
However, I can't find anything in Intellisense that is or resembles
something that I can use for this - -
What am I missing? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95321
More Treeview questions
when I add nodes (child nodes) to a treeview:
.Nodes.Add(cdl.FileName, ShowingText)
the first item shows as the 'key', like it was in VB6 - - -
However, when I want to refer to that key, I can't find anything in
Intellisense for that
like :
txtPath.text=TV1.SelectedNode. - - here's where I would have thought there
would have been a 'key' in the Intellisense - but it isn't
so how is it done? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95320
Need code / hints to do "masked" currency input
Hi everyone,
I need code to do a simple masked textbox entry for input of currency. The
requirements are...
1) Should support localization,
2) Should reject invalid keystrokes on a keystroke by keystroke basis,
3) Should reject valid keystrokes that result in an invalid currency value
(input of " $2.345" USD for example)
Nice to have would be...
4) Min / Max values
5) ability to input fractional cents / pesos etc. if desired
I can't seem to find this anyplace. I've found this type of functionality
in some of the third pary control suites, but I don't need anything as
complex / expensive as these look.
If I have to write it myself, I'm open to sugestions as to how I can do this
and still use the .Net localization features.
My current thought is to...
1) Make a custom textbox class that has a static string value that contains
a regex pattern that each keystroke should match. The pattern to match will
be determined
by examining CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalDigits
and CurrencyDecimalSeparator. I'm hoping the total number of regex patterns
is pretty small ( I only know of decimal and non-decimal currencies overall,
and only "." and "," as decimal separators - that only gives me four total
patterns if I don't consider fractional inputs) Plus I can always build my
regex pattern dynamically).
2) Validate the input string against the regex pattern on each keystroke.
"handle" any keystrokes that break the regex.
Any help is appreciated.
BBM Tag: How to tell if a form is covered, or entirely visible ? Tag: 95314
VS .NET 2003 - Cannot create items in Enterprise Framework projects
VS .NET 2003
Hello everyone,
I have made a few templates for all sorts of items (forms, usercontrols,
components...) and added them so I can pick them up from Project\Add\Add New
Item... menu. I have also made some changes to DAP.TDL and VSIDE.tdl policy
files. Everything was fine until yesterday when I have tried to change one
add-in that adds a few items automatically from templates.
I do not really know what went wrong but now I cannot add any item to
Enterprise framework projects. I can only add a DataSet in simple windows
project.
for example, when I try to add a form to project I get message:
"Could not run the 'C:\Program Files\Microsoft Visual Studio .NET
2003\VC#\CSharpProjectItems\LocalProjectItems\..\CSharpAddWinFormWiz.vsz'
wizard."
I would appreciate any clue.
TIA,
Vlado Tag: How to tell if a form is covered, or entirely visible ? Tag: 95313
Panels design
I have following situation:
On the righthand side of the form i have navbar and panel to the right.
Content of the panel is supposed to be different according to what user
chooses in the navbar.
How to do that at the moment of design.
How am I creating another panel with different content at the same place as
the previous one , what do I do with the previous content. Hide it??
I know that later i use the visibility option to dispay certain panels.
But how to acreate all of them at the same place in the designer?? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95312
Listen event on the different thread and update data on the UI thread
Hi,
Sorry for the long class. This time I am sending you much cleaner code.
Could you please respond me back, about "how to apply the threading", taking
the example of following scenario .
namespace ThreadingTest
{
public class Class1
{
public event EventHandler raiseResponse; //Event through which I can send
the received data
DataFeeder instDataFeeder = new DataFeeder(); //Object created
for the datafeeder component.
//Constructor
public Class1
{
//CustomEventHandler is the delegate to handle ResponseData event from the
DataFeeder component
instDataFeeder.ResponseData += new
CustomEventHandler(InstDataFeeder_ResponseData);
}
public void RequestData()
{
instDataFeeder.RequestDataFromRemoteServer();
}
public void InstDataFeeder_ResponseData(NewDataStructure newData) //
NewDataStructure contains multiple rows of data at the same time
{
//we receive this event really really really fast and I was
thinking of putting this event on the separate thread.
//Fill Datatable viz. dataTable1 from newData and then raise
event
If(raiseResponse != null)
raiseResponse(dataTable1,EventArgs.Empty); //
Sending the datatable in sender to avoid creating a custom class for event
argument.
}
}
//In the following usercontrol we need to bind the data received from our
own event -- raiseResponse
public class GridControl : System.Windows.Forms.UserControl
{
private DataGrid dataGrid1 = new DataGrid();
Class1 instClass1 = new Class1();
DataTable dt = new DataTable() ; //It has some of the same
columns received from the other class, Not creating the full structure for
the table.
//Constructor
public GridControl ()
{
instClass1. raiseResponse += new
EventHandler(instClass1_raiseResponse);
dataGrid1.DataSource = dt;
}
public void instClass1_raiseResponse(object sender,EventArgs e)
{
//If the data is coming up very fast then there will be problem
updating the UI and UI will freeze.
dataGrid1.SuspendLayout()
DataTable dt = (DataTable) sender; // I think assigning to the
datatable will update the datagrid.
dataGrid1.ResumeLayout()
}
}
}
Please help.
Regards,
Rajat. Tag: How to tell if a form is covered, or entirely visible ? Tag: 95305
Validation Control issue
Hi,
i'm developing website in .Net i used validation controls all over the site
they all are working fine here Localy but not working after uploading them
to web server. i uploaded my site at www.7host.com
kindly guid me about this
Regards
Noorali Tag: How to tell if a form is covered, or entirely visible ? Tag: 95304
Mdi child form
Hi,
i am trying to open mdi child form over mdi parent, but when i open the
child
he open larger then his real size.
what can i do to open it in his real size and in his real position.
Thanks,
Yossi Tag: How to tell if a form is covered, or entirely visible ? Tag: 95293
WebBrowser.DocumentText problem
Dear all,
I have added WebBrowser control in my program to display some message. I
assign text that I want to display to WebBrowser control by using
DocumentText property. Everything fine when I first assign the value but
there is nothing change when I try to assign another value to display again.
I've called Refresh() method but nothing display after the method is involve.
What should I do if I want the WebBrowser to display dynamic html text that
is generated from my program to display in WebBrowser control not only in
first assign value?
Thanks,
Teeravee Sirinapasawasdee Tag: How to tell if a form is covered, or entirely visible ? Tag: 95289
Framework 1.1 /2.0 Controls Hosted in Internet Explorer
Hi All,
I have a windows forms controls hosted in IE via the object tag
method. The control was built to run on 1.1 of the framework and works fine
whilst version 2.0 is not installed on the machine. When version 2 is
installed the executables are downloaded to the 2.0 temporary directory, even
though the assemblies where build under 1.1 and are referencing the 1.1
framework. That is, when 2.0 is installed they are downloaded to Documents &
Settings\<CurrentUser>\Local Settings\Application Data\assembly\dll3 instead
of Documents & Settings\<CurrentUser>\Local Settings\Application
Data\assembly\dll2.
Could anyone tell me if there is a setting to force IE to use the 1.1 temp
download cache? Or is it another assembly setting?
TIA Tag: How to tell if a form is covered, or entirely visible ? Tag: 95288
DataGrid View Paging
Hi,
May I know any VS 2005 data component that support paging? Why Asp.Net
got a paging function but not Windows? How do we implement paging for
DataGrid for WindowsForms.
Best regards,
Goh Tag: How to tell if a form is covered, or entirely visible ? Tag: 95287
VS2005 - UI can't load or find the DAL - What's up with that?
Hello,
Why can't my application recognize or find the data layer. These are
the design-time and runtime errors I receive.
\\
"One or more errors encountered while loading the designer. The errors
are listed below. Some errors can be fixed by rebuilding your project,
while others may require code changes.
The system cannot find the file specified. (Exception from HRESULT:
0x80070002)"
//
In the Error list it appears this way
\\
"Could not load file or assembly 'QmsDataLayer.dll' or one of its
dependencies. The system cannot find the file specified."
//
The dll is there. I have been using it all night. I made no changes to
it. Now I get this error.
I've rebuilt, closed, reopened. It is still located where it should be.
However, If follow the following three steps the form and code will run
again... for a while.
1.) I comment out this button code...
\\
Protected Overrides Sub btnOK_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnOK.Click
If _bAlreadyRun Then
'do nothing
'This is not needed because we close the form before that
can happen
Else
'Save to Quote table
InsertIntoQuote()
'Save to Version table
'UpdateDatasourceTable(_dataSet1.tbl010Quote)
insertIntoVersion()
'Update the database
'UpdateDatasourceTable(_dataSet1.tbl020Version)
_bAlreadyRun = True
End If
Me.Close()
End Sub
//
2.) I close all the code and forms
3.) I rebuild, close the IDE, and reopen.
Then it will run a few more times... then I will get an error again.
What is going on?
Any thoughts or suggestions?
Thank you,
dbuchanan Tag: How to tell if a form is covered, or entirely visible ? Tag: 95282
vs2005 - "given assembly name or codebase was invalid" error
Hello,
Why am I getting this error?
I don't know how to isolate it. It occurs intermittently. Has anyone
seen this before?
Here is the full text
\\
System.IO.FileLoadException was unhandled
Message="The given assembly name or codebase was invalid. (Exception
from HRESULT: 0x80131047)"
Source="QmsUI"
StackTrace:
at QmsUI.NewQuote.InsertIntoQuote()
at QmsUI.NewQuote.btnOK_Click(Object sender, EventArgs e) in
D:\DBuchanan MyDocuments\Visual Studio
2005\Projects\Qms_01\QmsUI\NewQuote.vb:line 15
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m,
MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext
context)
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine)
at QmsUI.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
//
Any suggestions for the causes or what it means
dbuchanan Tag: How to tell if a form is covered, or entirely visible ? Tag: 95281
vs2005 - 'The event Click is read-only and cannot be changed' - What?
Hello,
What does this error mean?
"The event click is read-only and cannot be changed"
This is a design-time error. It is displayed instead of the form.
Here is the full text
\\
"One or more errors encountered while loading the designer. The errors
are listed below. Some errors can be fixed by rebuilding your project,
while others may require code changes.
The event click is read-only and cannot be changed
at
System.ComponentModel.Design.EventBindingService.EventPropertyDescriptor.SetValue(Object
component, Object value)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAttachEventStatement(IDesignerSerializationManager
manager, CodeAttachEventStatement statement)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager
manager, CodeStatement statement)
//
I have made it go away by commenting out the following code. Then I
rebuild, close and reopen the solution.
(This is used within an inherited form thus the Overrides.)
\\
Protected Overrides Sub btnOK_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnOK.Click
'Save to Quote table
InsertIntoQuote()
'UpdateDatasourceTable(_dataSet1.tbl010Quote)
'Save to Version table
insertIntoVersion()
'UpdateDatasourceTable(_dataSet1.tbl020Version)
Me.Close()
End Sub
//
What is the problem?
dbuchanan Tag: How to tell if a form is covered, or entirely visible ? Tag: 95280
Determining length of a string in pixels
I am drawing text on a screen using graphicsObject.DrawString().
Prior to doing this I need to determine the length in pixels that the string
will be when it is rendered. I know I've read this before but can not find
it now that I need it.
Also - is there a simple way to center the text within a rectangel?
And - Thanks for your responses I really appreciate it! Tag: How to tell if a form is covered, or entirely visible ? Tag: 95275
MVC delegate problem...
In order to become more familiar with the Model-View-Controller pattern, I
have written a demo where each View is a plugin and the plugins are loaded at
startup from the plugins directory. When the View's are loaded they add
themselves to the DataModel View list...
FDataModel.AddView(this);
Where AddView looks like this...
public void AddView( MvcView view )
{
ViewChanged += new ViewChangedHandler(view.DataModified);
}
and at the right time I invoke the event list via...
ViewChanged(this, e);
This all works fine as long as I only have 1 instance of each type of view.
So in this case I have a Pie Chart View and Bar Chart view of the data ( as
well as the usual DataGrid view all as plugins ). Then the delegates
correctly fire and everything works as advertised. The problem arises if I
instantiate a second instance of say the Bar Chart. When that happens the
first Bar Chart stops responding/refreshing while the second Bar Chart
updates correctly.
Can any C# pattern gurus shed some light on what I might have overlooked? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95274
RichTextBox - Sending "zoomed" output to bitmap
I have code that allows me to basically write the contents of a
richtextbox to a bitmap (code below). This code works fine, but it
always draws the text "normal size" regardless of the setting of
ZoomFactor. How can I get the "zoomed" verison of the text into a
bitmap?
Thanks in advance!
-------------------------------------------------------------------------------------------------------------------------------------
[ StructLayout( LayoutKind.Sequential )]
private struct STRUCT_RECT
{
public Int32 left;
public Int32 top;
public Int32 right;
public Int32 bottom;
}
[ StructLayout( LayoutKind.Sequential )]
private struct STRUCT_CHARRANGE
{
public Int32 cpMin;
public Int32 cpMax;
}
[ StructLayout( LayoutKind.Sequential )]
private struct STRUCT_FORMATRANGE
{
public IntPtr hdc;
public IntPtr hdcTarget;
public STRUCT_RECT rc;
public STRUCT_RECT rcPage;
public STRUCT_CHARRANGE chrg;
}
[DllImport("user32.dll")]
private static extern Int32 SendMessage(IntPtr hWnd, Int32 msg,
Int32 wParam, IntPtr lParam);
[DllImport("user32.dll")]
private static extern Int32 SendMessageA(IntPtr hWnd, Int32 msg,
Int32 wParam, Int32 lParam);
// Windows Messages defines
private const Int32 WM_USER = 0x400;
private const Int32 EM_FORMATRANGE = WM_USER+57;
private const Int32 EM_GETEVENTMASK = WM_USER+59;
private const Int32 EM_REQUESTRESIZE = WM_USER+65;
private const Int32 EM_SETEVENTMASK = WM_USER+69;
private const Int32 ENM_REQUESTRESIZE = 0x40000;
/// <summary>
/// Render the RTF to a bitmap.
/// </summary>
/// <param name="measureOnly">If true, only the calculation is
performed,
/// otherwise the text is rendered as well</param>
/// <param name="g">Graphics object to render onto</param>
/// <returns>(Index of last character that fit) + 1</returns>
private int RTFToImage(bool measureOnly, Graphics g)
{
// Specify which characters to print
STRUCT_CHARRANGE cr;
cr.cpMin = 0;
cr.cpMax = -1;
// Specify the area inside page margins
STRUCT_RECT rc;
rc.top = PixelsToTwips(0, g.DpiX);
rc.bottom = PixelsToTwips((int)g.VisibleClipBounds.Height,
g.DpiX);
rc.left = PixelsToTwips(0, g.DpiX);
rc.right = PixelsToTwips((int)g.VisibleClipBounds.Width, g.DpiX);
// Specify the page area
STRUCT_RECT rcPage;
rcPage.top = PixelsToTwips(0, g.DpiX);
rcPage.bottom = PixelsToTwips((int)g.VisibleClipBounds.Height,
g.DpiX);
rcPage.left = PixelsToTwips(0, g.DpiX);
rcPage.right = PixelsToTwips((int)g.VisibleClipBounds.Width, g.DpiX);
// Get device context of output device
IntPtr hdc = g.GetHdc();
// Fill in the FORMATRANGE struct
STRUCT_FORMATRANGE fr;
fr.chrg = cr;
fr.hdc = hdc;
fr.hdcTarget = hdc;
fr.rc = rc;
fr.rcPage = rcPage;
// Non-Zero wParam means render, Zero means measure
Int32 wParam = (measureOnly ? 0 : 1);
// Allocate memory for the FORMATRANGE struct and
// copy the contents of our struct to this memory
IntPtr lParam = Marshal.AllocCoTaskMem( Marshal.SizeOf( fr ) );
Marshal.StructureToPtr(fr, lParam, false);
// Send the actual Win32 message
int res = SendMessage(Handle, EM_FORMATRANGE, wParam, lParam);
// Free allocated memory
Marshal.FreeCoTaskMem(lParam);
// and release the device context
g.ReleaseHdc(hdc);
return res;
}
/// <summary>
/// Convert between 1/100 inch (unit used by the .NET framework)
/// and twips (1/1440 inch, used by Win32 API calls)
/// </summary>
/// <param name="n">Value in 1/100 inch</param>
/// <returns>Value in twips</returns>
private Int32 HundredthInchToTwips(int n)
{
return (Int32)(n*14.4);
}
private Int32 PixelsToTwips(int n, float dpi)
{
return (Int32)(((float)n/dpi)*1440.0f);
} Tag: How to tell if a form is covered, or entirely visible ? Tag: 95273
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll
I had to reinstall Visual Studio.NET 2003 and ever since then I get this
error whenever my application tries to open a WindowsForm. Even the simplest
project with nothing more than a WindowsForm and a single button and no
custom code at all.
An unhandled exception of type 'System.ArithmeticException' occured in
system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation.
I never had this problem before... Is there something in my environment that
I need to set?
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =--- Tag: How to tell if a form is covered, or entirely visible ? Tag: 95266
Treeview add node as Child
with VB6 - to add a node as a child, to a specific node, I'd do something
like:
Tv1.Nodes.Add(Nodes.Add tv1.SelectedItem.Key, tvwChild, newKey, NewName
tv1.SelectedItem.Key was the Parent node -
But - as I'm trying to add something in, using VS.Net 2005 (skipped here
straight from vb6), the hints aren't giving me the same options -
Relative (1st item), and Relationship (2nd option) are not even
available....
where can I find info on how to do this in VS.Net 2005? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95265
FTP using Vb.Net2005
I want to get a file from a FTP server. How do I do it using vb.net 2005.
Please give me an example.
Please Help.
Thanks, Green Tag: How to tell if a form is covered, or entirely visible ? Tag: 95263
ComboBox.SelectedIndex behavior
I am using a combobox in an application that is databound to
a datatable. The visible item in the combobox corresponds
to the job classification of an employee: accountant,
manager, etc.
Due to data entry errors, some employees do not have a
classification in the db. For these entries, I want the
combobox to display nothing. I accomplish this by setting
the combobox's selectedIndex property to -1. In doing so,
I encountered some interesting behavior.
setting SelectedIndex = -1 always sets the SelectedIndex to
0, UNLESS the SelectedIndex is already 0 or -1.
(example)
myComboBox.SelectedIndex = -1;
produces a SelectedIndex of 0.
myComboBox.SelectedIndex = -1;
myComboBox.SelectedIndex = -1;
or
myComboBox.SelectedIndex = -0;
myComboBox.SelectedIndex = -1;
produces a SelectedIndex of -1.
Is this the expected behavior of this control, or is this a
bug in the control?
I'm using VS.NET 2003 and .NET 1.1.
Thank you,
John Kraft Tag: How to tell if a form is covered, or entirely visible ? Tag: 95253
Making UltraTreeNode in-place editable after adding it to the tree at run time
Hi,
I am an UltraTreeNode to Ultra at runtime. I want the control to be
in-place editable after adding it so that user can change the name. The
behaviour I am expecting is something like creating a new folder in
windows. When a new folder is created, the name is in-place editable.
Same has to be with adding node.
Can anyone help me in this regard?
Thanks in advance
Kiran Tag: How to tell if a form is covered, or entirely visible ? Tag: 95252
How to specify new DataRow as selected row in sorted DataGrid
I'm using c#, my DataTable is the datasource for a DataGrid, and the key in
the DataTable, "ID" column, is an autoincrement number
The Datagrid is not editable, data is added to the DataTable
programatically.
When I add a new DataRow to a DataTable using:
dr =DataTable.NewRow();
..code to fill the row..
dataAdapter.Update(DataTable);
I can get the ID of the new DataRow using @@IDENTITY as shown in the post
"Getting Autoincrement ID in ADO.NET".
How do I make the newly added DataRow the selected row in the DataGrid,
which may be sorted? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95251
Want a multi-line row in DataGridView
Greetings,
I am working on a ledger-style display using the DataGridView. I
have found a couple of ridiculously complicated ways that I can display
a second-line of information (all from the same DataRow) in the
DataGridView, but I was wondering what the recommended approach for
this is.
The DGV is supposedly far more configurable than its WinForms 1.1
predecessor, but lately I'm finding that I'm going to have to write
almost as much hacking code for the DGV as I did for the DataGrid.
Does anyone have a sample of a way in which I can display 2 lines of
data in a DataGridView? My first approach was to create custom columns
that had a cell type that displayed two lines of data, but I wasn't
sure how to get that to work well within edit mode and read mode, etc.
Any help would be greatly appreciated.
Thanks,
Kevin Tag: How to tell if a form is covered, or entirely visible ? Tag: 95248
windows user controls
I ve created my own control(containing tabcontrol) and added it to the panel.
How to access now that tabcontrol and add tha tabpages in the constructor of
my mainform??? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95246
ClickOnce settings disappear
I have deployed my application with ClickOnce, and it works fine.
There are a couple of user settings that the user is allowed to change
through a settings form. Also works fine.
BUT, when I did the most recent deploy all user settings were erased and set
back to their default values. NOT FINE!
I quote from the blog on: http://blogs.msdn.com/rprabhu/articles/433979.aspx
"Q: Okay, but how do I know when to call Upgrade?
A: Good question. In Clickonce, when you install a new version of your
application, ApplicationSettingsBase will detect it and automatically upgrade
settings for you at the point settings are loaded. In non-Clickonce cases,
there is no automatic upgrade - you have to call Upgrade yourself. ....."
So, normally the sepcified user settings should be upgraded automatically,
and I am pretty sure I got that behaviour before.
What can I possible have done?
How can I get it back? Tag: How to tell if a form is covered, or entirely visible ? Tag: 95245
Controls on multiple tabs
Is there a way to mirror a control onto multiple tabs? Have 1 listview
displayed on 2 tabs or 1 textbox displayed on 2 tabs but function as 1?
Thank you in advance. Tag: How to tell if a form is covered, or entirely visible ? Tag: 95241
C# class design
Is it possible to design a class in C# which should be not be re-entrant. eg
if Thread1 is calling any function on the object of that class then the same
thread should not allowed to call another function on the same object untill
the first call is finished. Tag: How to tell if a form is covered, or entirely visible ? Tag: 95238
Validation controls are not working
hi,
I'm developing a website using .net faramework version 1.1 the issue i'm
facing is I put validation controls on my pages they all are working fine
here localy but when i upload them on webserver they all stop working , I
hosted my site at www.7host.com I dont understand what is the issue. Kindly
help me out
Regards
Noorali Tag: How to tell if a form is covered, or entirely visible ? Tag: 95234
Maximize and resize Windows
Dear all,
I am a newby of .NET programming and I have a general question. If I
put some controls on a windows form (say with size 300,400), when I
resize the Window (enlarging it) or if I Maximize it, the controls
remain in the top left corner in the rectangle 300,400 making the whole
form look very bad.
If I resize Notepad, the multiline textbox within resizes too... I'd
like my applications do the same.
Are there techniques, articles, tutorials or something like that, that
can explain me how to handle this?
Thanks in advance. JC Tag: How to tell if a form is covered, or entirely visible ? Tag: 95232
FormView / GridView Connection
If someone could help...
My goal is to attach a FormView control to a GridView control such that
clicking the Select link on a record in the GridView will cause that record
to be displayed in the FormView control.
So far I've got the GridView displaying all the correct records, and the
FormView populating on the page's initial load. The FormView has its own
data source - it points to the same table the GridView uses, but has a
'where' clause that refers back to the GridView control on two fields. The
datasource has default values for those two fields, and the data that is
displayed on the initial page load reflects the record whose keys equal the
default values. So far, so good.
When I click another line's Select link, the page repaints, but the
FormView control is empty. Viewing the source I can see its skeleton, but
no content. I've breakpointed at the control's PreRender function, and the
DataItem is populated on the initial page load, but is null on the postback.
I'm sure I'm missing something fairly basic. Can I get a point in the
right direction?
Thanks,
Ben
--
bf001removethis@abovetheline.biz Tag: How to tell if a form is covered, or entirely visible ? Tag: 95231
Problem creating controls from other thread w/ invoke
Hi,
I have a form which acts as monitor for a service. The form and the monitor
communicate via remoting. Because it takes some time for the service to
startup some controls are added to the form when a certain event is raised
by the service.
However, when handling this event I do the following:
--------- snip ---------
private void EventProxy_Initialized(object sender, EventArgs e)
{
MethodInvoker invoker = new
MethodInvoker(this.CreateCommunicatorControls);
this.Invoke(invoker);
}
private void CreateCommunicatorControls()
{
// create controls and add them to a panel on the form
this.panelCommunicator.Controls.Add(newCommCtrl);
[...]
}
--------- snip ---------
The panel on the form is created from the main UI thread of the form., but I
still get the exception "Controls created on one thread cannot be parented
to controls on a different thread" when adding the new control to the panel.
Does anybody know what the problem is?
Regards,
Michael Tag: How to tell if a form is covered, or entirely visible ? Tag: 95226
Getting the list of colors!
Hi,
I want to retrieve the list of Colors available and display them in a drop
down combo. But the Color strcture doesnt seem to have a method that returns
the list of colors. Is there an enumerator that I can use?
Sinex Tag: How to tell if a form is covered, or entirely visible ? Tag: 95217
How to show transparaent label in window forms
Hi,
I try to add a label to a windows form, but as background is image, the
label need to be transparent, but it seems no transparent property
available, I found a one in web tab, but it does not work.
Help
Thanks
Jessie Tag: How to tell if a form is covered, or entirely visible ? Tag: 95213
How to show fields from related tables in same datagrid
I run VS .Net 2003. I have a distributed application with sql server 2000 and
windows front end, written in c#.
I have a number of tables in a dataset with relations between them. In one
single read-only datagrid I would like to display child rows from a child
table as well as one column from the parent table. How can I fix this in an
easy way?
I thought I could handle this via dataviews and dataviewmanager as source
for the datagrid, but I have not found any good article. I need a detailed
explanation as I am a novice on this.
I realize I could produce a new table on the windows client from the two
related tables, but as I consider the data structure to be well designed this
is not what I would like to do.
Regards
Tore Tag: How to tell if a form is covered, or entirely visible ? Tag: 95208
How to draw a 1 pixel long line using Graphics.DrawLine?
I am writing a Windows Forms application graphing routine using VS.NET 2003,
Visual C# and .NET Framework 1.1.
The Graphics.DrawLine(Pen,int,int,int,int) method seems to work okay unless
the desired line being drawn is only one pixel long (horizontally). I have
not found a way to get a horizontal line of only one pixel to be drawn. I
either get no line or a two pixel line.
Example method calls:
Graphics.DrawLine( Pen, 20, 50, 21, 50 ); // Results in two pixel long line.
Graphics.DrawLine( Pen, 20, 50, 20, 50 ); // Results in no pixels being
drawn.
So how do I get a one pixel long line?
Thanks,
Dave Tag: How to tell if a form is covered, or entirely visible ? Tag: 95205
Playing File Progress AVI
Is there a way in VB.NET 2005 to play the file progress avi file on a
Winform? I know there use to be a control in VB6 but there does not seem to
be one for .NET. I would rather not use external DLL's that I have to send
along with my EXE.
Thanks,
David
======================================
David McCarter
www.vsdntips.com
VSDN Tips & Tricks .NET Coding Standards available at:
www.cafepress.com/vsdntips.20412485 Tag: How to tell if a form is covered, or entirely visible ? Tag: 95202
ClickOnce
I have today gone to production with my first .net 2.0 Windows forms app. I
distributed it using click once. I was impressed with the .net framework
1.1, 2.0 looked even better from a developer point of view (generics are
brilliant). But I have to say click once is the best thing microsoft has
ever done.
I published the app to my webserver, sent everyone a link, sat back and
grinned. It felt so good I even built a quick enhancement just so i could do
an update in the afternoon. The last software distribution i did was a vb6
app and involved sending ~20Mb of install set around to 100+ people, so you
can imagine how good this felt.
Well done microsoft!
If you havent played with this technology then i would definitely suggest
you have a go.
Desktop Apps are back!
Cheers
--
David Steele
Recent VB6 - Dot net convert Tag: How to tell if a form is covered, or entirely visible ? Tag: 95200
Painting Problem
Hello,
I am currently using VB 2005 and having a problem I hope that some one
can help me with. Currently in my project, I create and add a panel at
run time and on this panel, I draw a gradient along with several text
strings. This panel is docked at the top of the form and I also create
another that is docked at the bottom of the form. The problem I am
experiencing is that whenever I hover over the min/max button or bring
up any shortcut menus like clicking on the control box, where ever the
tooltip or pop up menu was will leave nothing but the background color
of the panel instead of refreshing the the gradient and any strings
drawn in that section as well. However, this only happens when the
first one pops up, if any more pop up after that, the panel seems to
paint correctly in that area when the popup/tooltip disappears
(although the previous area will remain blank). If I minimize the form
and then bring it back up, the entire form is correctly drawn, but the
problem happens exactly as it did before where the first popup causes a
problem and the rest do not. The second part of the problem is when
tabbing over to another control... all of a sudden both panels drawn
will go completely blank to whatever the default background color is
and will only come back if minimizing the form and bringing it back up
again. Below is the code I am using in my form (the panels
uxHeader/uxFooter are simply added during the form_load event with all
their defaults aside of dock and height), hopefully someone can see my
problem or suggest a resolution to it, thanks in advance:
Public Class form_main
Private Sub form_main_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) Handles
Me.Paint
DrawGradient( _
0, 0, uxHeader.Width, uxHeader.Height, _
Color.Black, Color.LightSlateGray, uxHeader,
Drawing.Drawing2D.LinearGradientMode.Vertical)
DrawGradient( _
0, 0, uxFooter.Width, uxFooter.Height, _
Color.LightSlateGray, Color.Black, uxFooter,
Drawing.Drawing2D.LinearGradientMode.Vertical)
DrawString( _
uxHeader, "Data Copy Setup", Brushes.SteelBlue, 11, 48,
_
New Font("Trebuchet MS", 14, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxHeader, "Data Copy Setup", Brushes.White, 10, 47, _
New Font("Trebuchet MS", 14, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxHeader, "Citizens Bank", Brushes.SteelBlue, 306, 10,
_
New Font("Trebuchet MS", 12, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxHeader, "Citizens Bank", Brushes.White, 305, 9, _
New Font("Trebuchet MS", 12, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxHeader, "Wintel Services", Brushes.SteelBlue, 306,
23, _
New Font("Trebuchet MS", 24, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxHeader, "Wintel Services", Brushes.White, 305, 22, _
New Font("Trebuchet MS", 24, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxHeader, "Migration Data Copy Tool",
Brushes.SteelBlue, 338, 48, _
New Font("Trebuchet MS", 12, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxHeader, "Migration Data Copy Tool", Brushes.White,
337, 47, _
New Font("Trebuchet MS", 12, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxFooter, "version 1.0.0", Brushes.SteelBlue, 416, 21,
_
New Font("Trebuchet MS", 10, FontStyle.Bold,
GraphicsUnit.Pixel))
DrawString( _
uxFooter, "version 1.0.0", Brushes.White, 415, 20, _
New Font("Trebuchet MS", 10, FontStyle.Bold,
GraphicsUnit.Pixel))
End Sub
'---------------------------------------------------------------------------------------------------------------------------------
' Sample Call:
'
' DrawGradient( _
' 0, 0, uxHeader.Width, uxHeader.Height, _
' Color.Black, Color.Gainsboro, uxHeader,
Drawing.Drawing2D.LinearGradientMode.Vertical)
'---------------------------------------------------------------------------------------------------------------------------------
Private Sub DrawGradient( _
ByVal x As Integer, _
ByVal y As Integer, _
ByVal w As Integer, _
ByVal h As Integer, _
ByVal color1 As Color, _
ByVal color2 As Color, _
ByVal ctrl As Control, _
ByVal mode As System.Drawing.Drawing2D.LinearGradientMode)
Dim a As New System.Drawing.Drawing2D.LinearGradientBrush(New
RectangleF(0, 0, ctrl.Width, ctrl.Height), color1, color2, mode)
Dim g As Graphics = ctrl.CreateGraphics
g.FillRectangle(a, New RectangleF(x, y, w, h))
g.Dispose()
End Sub
'---------------------------------------------------------------------------------------------------------------------------------
' Sample Call:
'
' DrawGradientString( _
' "Sample", Color.Blue, Color.Firebrick, _
' Drawing.Drawing2D.LinearGradientMode.Vertical)
'---------------------------------------------------------------------------------------------------------------------------------
Private Sub DrawGradientString( _
ByVal text As String, _
ByVal color1 As Color, _
ByVal color2 As Color, _
ByVal mode As System.Drawing.Drawing2D.LinearGradientMode)
Dim a As New System.Drawing.Drawing2D.LinearGradientBrush(New
RectangleF(0, 0, 100, 19), color1, color2, mode)
Dim g As Graphics = Me.CreateGraphics
Dim f As Font
f = New Font("verdana", 16, FontStyle.Bold, GraphicsUnit.Pixel)
g.DrawString(text, f, a, 10, 100)
g.Dispose()
End Sub
'---------------------------------------------------------------------------------------------------------------------------------
' Sample Call:
'
' DrawString( _
' Me, "Wintel Operations", Brushes.Black, 12, 102, _
' New Font("Trebuchet MS", 24, FontStyle.Bold,
GraphicsUnit.Pixel))
'---------------------------------------------------------------------------------------------------------------------------------
Private Sub DrawString( _
ByVal ctrl As Control, _
ByVal text As String, _
ByVal b As Brush, _
ByVal x As Integer, _
ByVal y As Integer, _
ByVal f As Font)
Dim g As Graphics = ctrl.CreateGraphics
g.DrawString(text, f, b, x, y)
g.Dispose()
End Sub
End Class Tag: How to tell if a form is covered, or entirely visible ? Tag: 95199
Multi-page configuration with TreeView. How is it done?
Hi there,
I need to do something like the Visual Studio "settings" window, i.e.,
having a TreeView on the left side and some kind of multi-panel (or
multi-page) control on the right side.
What should I use on the right side? I thought it was a TabControl, but I
can't find a way to make the TabPage headers invisible.
Thanks in advance for any ideas,
-Benton
Using VS 2005. Tag: How to tell if a form is covered, or entirely visible ? Tag: 95195
Derived DataGrid not displeyed correctly
Hi!
I derived a new class from a DataGrid control and added some functionality
to it. Among other things a method that autosizes the columns displayed.
When I change the data source and data member of the datagrid after having
updated some data in it, it sometimes does not display correctly. What
happens is that some cells from the old view is visible in the new view. I do
not know what is the problem, but my guess is that it has something to do
with the repainting of the derived datagrid.
Do I need to do something in the derived data grid to get the painting to
work correctly?
--
/ ScubaD Tag: How to tell if a form is covered, or entirely visible ? Tag: 95194
Screen Savers: How do I spawn a process...
I have a machine that will be used to demo some Excel spreadsheets at a
convention. Because I did not author the spreadsheets and attendees will be
allowed to play with the spreadsheets, I needed a way to periodically
restore the original versions. In addition to the "always-on-top click this
button to reset demo" application I wrote, I chose to use screen saver code
to reset the demo after a period of inactivity in the event an attendee just
walked away. I chose the screen saver method because I was unsure how to
capture the system traps since my reset-app will not always have focus and
so using the screen saver method seemed to be the quickest/easiest solution.
So...
I can spawn a new process from an application and that process remains
running after the application is closed. This is good.
Using the same code in a screen saver and running it while its an .EXE
(prior to renaming it .SCR & relocating it to the system directory), the new
process remains running after the screen saver application is closed. This
is good.
I rename the screen saver to .SCR, relocate it in the system directory,
right-click the Desktop background, select Properties / Screen Saver / etc.,
click the Preview button to execute the screen saver and the new process
remains running after I select Ok or Cancel to cancel the screen saver. This
is good.
Now I allow the system to kick off the screen saver at whatever inactivity
timeout. The screen saver executes, the new process executes but it closes
when the screen saver closes. This is bad.
Here is the code being used:
private void ScreenSaverForm_Load(object sender, System.EventArgs e)
{
string InstallPath =
(string)Registry.LocalMachine.OpenSubKey(@"SOFTWARE\MyApp").GetValue(@"Path");
ProcessStartInfo startInfo = new ProcessStartInfo(InstallPath +
@"\MyFile.xls");
startInfo.WindowStyle = ProcessWindowStyle.Maximized;
Process.Start(startInfo);
Close();
}
I have also tried including "startInfo.UseShellExecute = true;" but results
were the same.
Unless I am totally off then obviously the operating system is
handling/executing screen saver code differently at the final stage. Other
than basic skeleton code required for a screen saver, I am unable to find
any 'real' documentation on screen saver programming. For example, through
trial & error I discovered that the screen saver filename must follow the
8.3 naming convention - unless I'm doing something wrong there as well?
Anyway...
1. Most importantly, what is the code for spawning a new process from within
a system activated screen saver such that the new process remains running
after the screen saver closes?
2. Is a screen saver filename in fact limited to the 8.3 naming convention?
3. Where is the screen saver application name set or read from? For example;
if your filename is 'ssMyDemo.scr' then the system will drop the prefix of
'ss' and display 'MyDemo' in the screen saver list. If there is no 'ss'
then the filename, excluding extension, will display in the screen saver
list. But if you examine a default OS provided screen saver you will see
that the filename 'ss3dfo.scr' displays as '3D Flying Objects' in the screen
saver list. How is this accomplished?
4. Is there a "Everything you ever wanted to know" type source on screen
saver programming; net, book or otherwise?
TIA,
-Jeff Tag: How to tell if a form is covered, or entirely visible ? Tag: 95193
Event question
I have a component (Say Component1 )which has two public functions and one
event(Say Func1 and Func2 and event is MyEvent) This component is being used
by a second component(Say Component2)
Here is the flow of events
1) Component2 intantiates Component1
2) Component2 registers for the event MyEvent
3) Component2 calls function Func1
4) In Func1 of Component1 the event MyEvent is raised. Func1 has to do more
work but event is raised in the middle of Func1.
5) Component2 receives event and calls Func2.
In this test case I just want to know is there a way to detect/prevent
Component2 from calling Func2 until the call to Func1 ends. It is kind of
reentry problem of the Component1. Because the Component1 is not thread safe.
The Func2 changes the state of the Component2. In this case after executing
Func2 the code will fall back to Func1 which will see a changed state.
Is there a way to stop it or making Component2 not to be re-entrant.
Thanks in advance Tag: How to tell if a form is covered, or entirely visible ? Tag: 95192
ProfessionalColors class cheat sheet
I'm looking for a visual cheat sheet for using the ProfessionalColors
class with the 2.0 framework controls.
Sean Lively Tag: How to tell if a form is covered, or entirely visible ? Tag: 95191
Sample from MSDN on <ApplicationSettingsBase Class> has a Resize
Hello,
I have a problem with the sample from the following article:
http://msdn2.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.aspx
When the form is resized from the left side, or top, it will change the
location to the point where it was resized to and keep the original size.
I am assuming that this is not the default behavior in this case.
Is there a workaround?
Thanks.
Regards,
Genadij. Tag: How to tell if a form is covered, or entirely visible ? Tag: 95188
Disable Sorting in VB.NET
I thought the only thing I had to do to disable column sorting in
VB.NET was to set datagrid.AllowSorting = False. Unfortunately this
has never worked for me. I discovered another set of code that seems
to work for 99% of the cases where I need to disable datagrid column
sorting:
Private Sub datagrid_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles datagrid.MouseDown
Dim pt As New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = dgACE.HitTest(pt)
If hti.Type <> DataGrid.HitTestType.ColumnHeader Then
MyBase.OnMouseDown(e)
End If
End Sub
However, this code does not work when my datagrid resides on a user
control. The datagrid_MouseDown event is triggered but sorting still
occurs for the column. It's critical that I disable sorting in the
datagrid due to the other things I am trying to do with the datagrid.
I'm about ready to pull my hair out trying to figure this one out so
any suggestions on how to resolve this issue would be greatly
appreciated!
Thank you!
Joy Tag: How to tell if a form is covered, or entirely visible ? Tag: 95186
FlowLayoutPanel - Move Control (.NET 2.0)
Is there a way of changing the position of a control in a FlowLayoutPanel?
The only ways I can see is by systematically calling BringToFront on each
control in the right order or by pulling all the control out and ading them
back again in the correct order. Both these ways seem to me to be kludges.
TIA Tag: How to tell if a form is covered, or entirely visible ? Tag: 95185
How to combine AutoScroll and virtual content scroll
I am a .NET newbie and started working on al user control, where one scroll
dimension -- say horizontal -- moves the contained controls (like AutoScroll)
and the other dimension leaves the controls sticky and updates the virtual
content of the contained controls -- lets say some text boxes -- with .NET
2.0.
I tried to use AutoScroll by setting
ScrollableControl.AutoScrollMinSize.Height to the virtual content size and
updating the content of my text boxes by using a Scroll event handler. But
this also moved my text boxes vertically and I was not able to reset their
location without introducing flickering. Question: Is there a way to make
some contained controls remain sticky or is there a way to make to movement
of the controls invisible?
My second approach was to use manual scrolling. Besides that this approach
introduces a lot more code and I had to do the layout manually, it introduced
flickering of the scroll bars when resizing. I assume that this is introduced
by the timig of layouting and control-repainting. With my first approach by
using AutoScroll there was no flickering when resizing the control. Question:
Is there a flicker save way to do layouting and painting of contained
controls.
Thanks in advance for any hints. But I want to do it purely using platform
independent .NET code, so overriding WndProc or using P-Invoke is not an
option for me. Tag: How to tell if a form is covered, or entirely visible ? Tag: 95183
Fonts and Labels in a Windows Form Messed Up?
I'm converting a .NET 2.0 Beta project to the final version using Visual
Studio. In doing so, I've come across a strange problem with the fonts in my
labels. To see the problem, I have an empty form with 2 labels, one "Timing
Details:" and one "Package Details:" - each one Bolded. When viewing the
form in design mode within Visual Studio, everything looks good - as
expected. But when I run the form, the word "Details" in each of the two
labels looks different. The second one looks scrunched up.
Here's the guts of my form code - nothing out of the ordinary as far as I
can tell:
partial class Form1 {
private void InitializeComponent() {
this.packageDetailsGroupLabel = new System.Windows.Forms.Label();
this.timeDetailsGroupLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// packageDetailsGroupLabel
//
this.packageDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft
Sans Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.packageDetailsGroupLabel.Location = new System.Drawing.Point(12,
47);
this.packageDetailsGroupLabel.Name = "packageDetailsGroupLabel";
this.packageDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.packageDetailsGroupLabel.TabIndex = 22;
this.packageDetailsGroupLabel.Text = "Package Details:";
//
// timeDetailsGroupLabel
//
this.timeDetailsGroupLabel.Font = new System.Drawing.Font("Microsoft Sans
Serif", 8.25F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.timeDetailsGroupLabel.Location = new System.Drawing.Point(12, 9);
this.timeDetailsGroupLabel.Name = "timeDetailsGroupLabel";
this.timeDetailsGroupLabel.Size = new System.Drawing.Size(163, 13);
this.timeDetailsGroupLabel.TabIndex = 21;
this.timeDetailsGroupLabel.Text = "Timing Details:";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(220, 79);
this.Controls.Add(this.packageDetailsGroupLabel);
this.Controls.Add(this.timeDetailsGroupLabel);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
private System.Windows.Forms.Label packageDetailsGroupLabel;
private System.Windows.Forms.Label timeDetailsGroupLabel;
}
If you have any ideas, or would like to see a screenshot of what I'm talking
about, please let me know.
Thanks,
Chris Tag: How to tell if a form is covered, or entirely visible ? Tag: 95181
Is this possible from VB.NET ?
If not how about interoping Windows ?