How to do dockable form in MDI?
How do I create a dockable windows form within an MDI
parent?
The behavior is similar to the IDE interface, with mdi
child windows in the center and property windows docked
to the right. I want to create a property window that is
either floating or docked to one side of the MDI parent. Tag: protect my code from decompile Tag: 52120
Controling C# Forms in Windows Application
I'm a web applications developer and I'm being asked to write this
windows application so I'm sure this is an easy answer but It's not
jumping out at me.
I have an application that uses several forms in a single windows
application. I need to be have the user click a button and have it
bring up a different form. These forms aren't generated on the fly
they are hardcoded. For example the entry point of the application
has a welcome menu with a login. If the user is a new user they need
to fill out a account form. This form is located on a seperate
windows form then the login / welcome menu.
Thanks in Advance for all help and suggestions
Braden Bowers Tag: protect my code from decompile Tag: 52118
Controling C# Forms in Windows Application
I'm a web applications developer and I'm being asked to write this
windows application so I'm sure this is an easy answer but It's not
jumping out at me.
I have an application that uses several forms in a single windows
application. I need to be have the user click a button and have it
bring up a different form. These forms aren't generated on the fly
they are hardcoded. For example the entry point of the application
has a welcome menu with a login. If the user is a new user they need
to fill out a account form. This form is located on a seperate
windows form then the login / welcome menu.
Thanks in Advance for all help and suggestions
Braden Bowers Tag: protect my code from decompile Tag: 52117
Strange Issue with MDI childs and Merged menus.
Have a MDI parent with a menu and a MDI child with a menu that gets added to
the parent - nothing fancy. One the parent, there is a menu (file/new) item
that loads and shows a new child. Works fine so far. However, if you click
(file/new) 2 or 3rd times, without actually clicking on the new child first,
I will get: "An unhandled exception of type 'System.NullReferenceException'
occurred in system.windows.forms.dll Additional information: Object
reference not set to an instance of an object."
However, if I click inside the ListView in the first child (I think because
it changes the focus off the menu) then I can continue creating children
without this error. You must *actually click the control as setting the
focus in the code does not stop the problem. This does not happen if I
remove the menu from the child or if I do not start the child as MDI.
Therefore, I am guessing it is an issue with merged menus and/or mdi
children. Anyone run into this before? Is there a way to simulate the
mouse click in code (i.e. not just setting the focus).
--wjs Tag: protect my code from decompile Tag: 52115
how to display multiple image on a windows form...
hiye people... how can i display multiple image on a
windows form? my image will be from a folder somewhere on
the local machine. whats the best method to display
multiple image?
yours truly
simon Tag: protect my code from decompile Tag: 52109
Intercepting events
Hello all,
I have a form with several controls(buttons) on it. I want
to start a screen saver after nothing has been pressed for
10 min. And of course if something has been pressed, to
restart the timer. To to this I have to trap each
control's Click event and restart the timer from there. Is
there a way to do this only once, somehow to hook before
each control's Click event or something sismilar?
Is there a way the form to intercept an event going one of
its controls?
Thank you Tag: protect my code from decompile Tag: 52104
Intercepting events
Hello all,
I have a form with several controls(buttons) on it. I want
to start a screen saver after nothing has been pressed for
10 min. And of course if something has been pressed, to
restart the timer. To to this I have to trap each
control's Click event and restart the timer from there. Is
there a way to do this only once, somehow to hook before
each control's Click event or something sismilar?
Is there a way the form to intercept an event going one of
its controls?
Thank you Tag: protect my code from decompile Tag: 52103
Windows Forms Inheritance, Incomplete?
I was playing around with Windows Forms
and found out this Forms Inheritance feature.
The moment I saw that, I felt this can be
used effectively if the application
contains couople of forms which have
a consistant look and also shares
SOME similar functionality between the forms.
Lets say for example, I have 2 forms and both
forms have buttons as (New, Edit, Save, Close)
Both the forms before showing, should do a
security check(say in forms load event)
In the old vb scenerio, we would create 2 similar
forms seperately and do code cut and paste
for each form which have the similar functions.
But here, with forms inheritance this should
be automaticaly done. But what happense when
u inherit a form at the moment is, it only
sets the controls MODIFIER poperty to
say Protected, Proteted Internal etc..
But If I want to override the parent forms
functionality , say overriding CLOSE buttons
click method, I have to manually edit
the parents click event as;
protected virtual void btnClose_Click(object sender, System.EventArgs e)
and then edit the close button event in the
child form to;
protected override void btnClose_Click(object sender, System.EventArgs e)
And then, in the child forms' event registration for
CLOSE button should be removed/commented(the line below).
//this.btnClose.Click += new System.EventHandler(this.btnNew_Click);
Otherwise, when the child instance get created
it will register 2 events(cause it goes up the
inheritance hierachy and creates parent form instance
first and then come back to child form)
so if u click CLOSE button once,
it will call the close method twise!!!!!
My question is why they didn't automate this couple
of steps ? If a forms controls have been set to
Protected / Protected Internal, they could have
generate the code so that it will really
work.
I want to know what you guys think. May be
I have taken the whole thing from the wrong
end.
May be forms inheritance is there ONLY to get the
UI duplicated? is it?
Regards
KK Tag: protect my code from decompile Tag: 52098
Bug in datatable.select
If you use a datatable select on a column that contains a GUID you will have
a major problem if you are not using US language.
We are using Danish language and when selecting like this:
ds.Tables(0).Select(GuidColumn = 'SomeGUID')
It will not always return the row as expected, I suspect the problem is that
in Denmark the character "å" is the same as "aa" and one side of the
equation returns "å" while the other returns "aa".
This is a serious bug and should be fixed ASAP - I have reported this to MS
6 months ago, but to no avail.
For anyone interested I can send a project that demonstrates this behaviour.
Regards
Thorben Jensen Tag: protect my code from decompile Tag: 52093
What is the best method to display multiple data
hiye good people of devCity, I'm new to the .net world.
i've recently been assign a task to display multiple data
ON A WINDOWS FORM. if this task were to be completed in
asp.net i would use datagrid and all its wonderful feature
to customize the output of it. but sadly, i'm not...
anyway, since my app would be in a windows form, do i
still need to use datagrid to display multiple rows of
data or is there a better tool out there and i'm not aware
of it? and if i were to stuck with datagrid, can someone
show me some sites on the net on how to customize the
datagrid the way asp.net does?
your help is greatly appriciated...
yours truly
Simon Tag: protect my code from decompile Tag: 52092
Quote extraction from Yahoo Historical Quotes
I have the following method that retrieves quotes from the Yahoo historical
quotes web page.
According to their FAQ, there is no limitation on the number of quotes one
may download, and because the problem seems to come and go, I'm concerned it
may be a problem with my code.
In particular, the problem seems to occur when I retrieve quotes over a long
period of time. Normally the routine runs every night and downloads the
previous days quotes. Occasionally, however, I'll download one or more years
worth of quotes for several stocks. It's on these occasions when the code
seems to fail. It doesn't fail the first time, though, and it won't
necessarily fail on the stock that I'm retrieving multiple quotes from.
The exception that is thrown is: "System.Net.WebException: The underlying
connection was closed: The server committed an HTTP protocol violation." The
exception is thrown at wrq.GetResponse().
I originally thought it was because I was going through a machine using
Internet Connection Sharing, but then I did it directly to the internet
without a proxy, and the same problem occurred.
Anyone have any ideas? Code follows:
public QuoteList GetQuoteHistory(Stock StockOb, DateTime StartDate, DateTime
EndDate)
{
if (StartDate.Year < 1970)
{
StartDate = new DateTime(1997, 1, 1);
}
bool done = false;
int tryCount = 0;
QuoteList list = new QuoteList();
while (!done)
{
// Build url query string
string url = @"http://" + yahooIP + @"/table.csv?a=" +
((int)(StartDate.Month - 1)).ToString() + @"&b=" +
StartDate.Day.ToString() +
@"&c=" + StartDate.Year.ToString() + @"&d=" +
((int)(EndDate.Month - 1)).ToString() + @"&e=" + EndDate.Day.ToString() +
@"&f=" + EndDate.Year.ToString() + @"&s=" + StockOb.Ticker +
@"&y=0&g=d&ignore=.csv";
WebRequest wrq = null;
Stream strm = null;
StreamReader sr = null;
try
{
wrq = WebRequest.Create(url);
wrq.Timeout = 30000;
wrq.Proxy = WebProxy.GetDefaultProxy();
strm = wrq.GetResponse().GetResponseStream();
sr = new StreamReader(strm);
}
catch(System.Exception ex)
{
if (null != sr)
{
sr.Close();
}
if (null != strm)
{
strm.Close();
}
// Check to see if the operation timed out. If it did,
// retry a couple of times.
if ("The operation has timed-out." == ex.Message)
{
tryCount++;
if (tryCount > 2)
{
return null;
}
continue;
}
else
{
return null;
}
}
string line;
try
{
// If there's no day, close out.
if (null == (line = sr.ReadLine()))
{
return null;
}
while (null != (line = sr.ReadLine()))
{
// Parse quote data nad add the quote if it's not already in the
// list of quotes
char[] splitCh = new Char[1];
splitCh[0] = ',';
string[] items = line.Split(splitCh);
Quote quote = new Quote();
quote.QuoteDate = Convert.ToDateTime(items[0]);
quote.OpenPrice = (float)Convert.ToDouble(items[1]);
quote.HighPrice = (float)Convert.ToDouble(items[2]);
quote.LowPrice = (float)Convert.ToDouble(items[3]);
quote.ClosePrice = (float)Convert.ToDouble(items[4]);
quote.Volume = Convert.ToInt32(items[5]);
if (false == list.ContainsKey(quote.QuoteDate))
{
list.Add(quote.QuoteDate, quote);
}
}
}
catch(System.Exception ex)
{
Trace.WriteLine("Unknown exception processing request: " +
ex.ToString());
}
finally
{
// Close everything nice and clean
sr.Close();
strm.Close();
done = true;
}
}
return list;
} Tag: protect my code from decompile Tag: 52090
TreeView with adjustable TreeNode height
Hi,
Does anyone know a third party TreeView control with the possibility to
adjust (programmatically) independently the heights of the TreeNodes? i.e.
sort of multiline TreeNode.
(Or would it be feasible to construct such one by yourself inheriting from
the .NET TreeNode class?)
Ron Tag: protect my code from decompile Tag: 52089
mdi scrollbars - now tearing my hair out!
Hi all!
Original question:-
Is it possible to disable the scrollbars that appear on
an MDI parent form, so when the child forms are dragged
outside the forms client area the scroll bars do not show!
----------------
Still can't seem to find any info on how this is done!
Searched everywhere on the net tried EnableScrollBar and
ShowScrollBar, so please can anyone help with this almost
impossible problem!
Thanks in advance,
Carl Prentice. Tag: protect my code from decompile Tag: 52088
About the samples in MSDN TV Data Validation in Smart Client Applications
I'm a regulary watcher of MSDN TV. I recently watched the episode Data
Validation in Smart Client Applications.
I'm very interested in one of samples - the validation sample. I'm very
surprised that when a validation component is added onto the form, it
dinaymically adds new properties to a TextBox control!
I went to the site mentioned in the show, but the samples are not there (I
got the ever existing 404 error).
Can someone tell me that is the key technique to dynamically add properties
to a control on a form? Tag: protect my code from decompile Tag: 52085
problem with form1.show
If I use the command form1.showdialog() the form appears
and stays on the screen.
However, if I use form1.show() it appears then
immediately closes. I've spent two hours pulling my hair
out on this one, thumbing through 3 vb.net books.
For now I'm using showdialog, but I need the 'real thing'.
Thanks in advance.
dennist Tag: protect my code from decompile Tag: 52080
Icon's size problem
Hi!
I've copied some ico file;
on this copy I've worked under VS to graphicaly modiffy icon;
the result is that I can only change picture of the max-res icon.
Problem - how to convert this "big" to other sizes?
Is there any soft under VS (or other) that can make this conversion?
Thx in advance
KW. Tag: protect my code from decompile Tag: 52075
Thanks all - Suggestions for Disable Ctl+Alt+Del C#
Dear Friends
Thanks for all your suggestions.
Brain Thank you for your source code and valuable suggestions.I am working
on it...
Thanks,
Dev Tag: protect my code from decompile Tag: 52058
How many threads
Hi,
If I have a code like this:
class Foo
{
public Form1 frm1;
public Form2 frm2;
public static void Main()
{
frm1=new Form1();frm2=new Form2()
Application.Run(frm1);
}
}
How many threads will I have in my process (excluding the
CLR's ones)?
Does creation of a form create a thread, too?
I think it does because where else the forms' message
loops will reside, but I am not sure
Thank you Tag: protect my code from decompile Tag: 52057
Strange TextBox behavior when 2 or more text boxes are placed next to each other.
We have several forms that use textBoxes to collect info from the user. It
seems that when we have 2 text boxes stacked one below the other, when the
user types in the second one the text is actually entered into the first
one. We thought that maybe upgrading to .NET 1.1 might solve this issue,
but it is still there. Tag: protect my code from decompile Tag: 52040
form with datagrid steals focus
Hi. I'm having a very annoying focus problem. I have a class
(MyDataList) which implements CollectionBase and IBindingList. This
class is bound to a data grid.
whenever my MyDataList is updated [example: OnListChanged(new
ListChangedEventArgs(ListChangedType.Reset,-1));] (another thread
invokes updates on the UI thread) the form containing the DataGrid
takes focus and then acts like something set TopMost = true on the
containing form!
I can't figure out what is causing this, and it's driving me insane!!
Has anyone encountered this before, and found a fix? Or does anyone
have a suggestion? (extend DataGrid and override some protected
event?) Tag: protect my code from decompile Tag: 52038
Visual Inheritance for ComboBox
Hi All,
Just been toying around with inheriting from the ComboBox control. See below
a simple example of the new ComboBox class.
// start MyComboBox.cs file
using System;
using System.Windows;
using System.Windows.Forms;
using System.Drawing;
namespace MyComboBox.UI
{
/// <summary>
/// Summary description for MyComboBox.
/// </summary>
public class MyComboBox : ComboBox
{
public MyComboBox()
{
this.ForeColor = Color.DarkBlue;
}
protected override void OnHandleCreated(EventArgs e)
{
if (this.DesignMode)
{
this.Items.Add("Design Mode");
}
else
{
this.Items.Add("Run-time Mode");
}
this.Items.Add("Orange");
this.Items.Add("Apple");
this.Items.Add("Pie");
}
}
}
// end
There's no problem adding the control to my toolbox. Also - no problem
dragging and dropping the custom combo onto the design canvas.
Strange thing is, after switching between design time and code a couple of
times and running it - the font seems to change into a bigger font,
something like Arial bold or such.
Also, I suppose I need to specify some attribute tags before the class
definition. Any ideas or suggestions?
Thanks a bunch,
Wim Hollebrandse Tag: protect my code from decompile Tag: 52023
Menu shortcut keys do not work when Form.Show is called.
I have a form that I build in C# that does not seem to annunciate a menu
item selection when a shortcut key is pressed. It only seems to occur if I
display the form using the Form.Show() method. The problem does not seem to
occur when I use Form.ShowDialog().
Can someone explain how I can get around this problem?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
varnk@diebold.com
----------------------------------- Tag: protect my code from decompile Tag: 52012
MDIChild forms maximizebox.
Hello ALL,
I have this situation:
1. A MDI Form named frmPrincipal;
2. A MDIChild form named frmCustomers;
When I show the frmCustomers form, from a click event of a button of
frmPrincipal, like this:
frmCustomers.MdiParent = this;
frmCustomers.WindowState = FormWindowState.Maximized;
frmCustomers.Show()
The frmCustomers form shows ok, but the minimizebox, maximizebox and
controlbox appears, and I can´t like this.
In the frmCustomers properties I set false to maximizebox, controlbox and
minimizebox, but they appears yet.
I try to remove the border of the form (set FormBorderStyle = None) but
don´t work too.
Please, how can I hide this buttons?
Thanks in advance and sorry my English.
Fernando Lopes
Marília - São Paulo - Brazil. Tag: protect my code from decompile Tag: 52009
Problem with drawing over the top of a background form
Hi, I am hoping someone can point me in the right direction. I am working on
a program that has a form that has a background mage that the user can
change. Currently I assign in directly to background image. After an image
is assigned to the background the user has the ability to draw rectangles on
the image using the mouse to define the regions. To do that I create a
bitmap and constantly redraw the rectangles on it that are stored in a
linked list each time the form repaints.. the problem is that because of
this bitmap, I never see the image assigned to the background. Of course
this makes sense since I am creating a bitmap. I've tried setting the bitmap
to be transparent, and that allows me see the background image, but
everytime I use the mouse to draw or resize a region, it doesn't refresh
properly and I'm left with tons of rectangles on the screen, instead of just
the final rectangles position. Is there any easier way to do this? I've also
tried to assigned the .BMP image I use directly as the bitmap I am creating
the rectangles on rather then the background, but then I get another error
saying
"Additional information: A Graphics object cannot be created from an image
that has an indexed pixel format."
The bmp is an 8 Bit format image. I've also tried converting it to a GIf
with no success.
I was going to post some of the code, but figured the post was long enough,
if anyone is interetsed in seeing what i have so far, just let me know. I
appreciate any help you guys can give me. Tag: protect my code from decompile Tag: 52006
Simple way to force a form to validate
Is there a simple way to force a form to invoke validation on all its
controls.. I want to do this on a button_click prior to doing some
processing..
Thanks Tag: protect my code from decompile Tag: 52005
HOWTO: Remove the left indicator column of a datagrid?
Hello ALL,
Please, is there any way to remove the indicator column (that´s in the left)
of a datagrid in windows forms?
Thanks for help.
[]s
Fernando Lopes
Marília - São Paulo - Brazil Tag: protect my code from decompile Tag: 52002
Pointing to custom forms
When we create a new win usercontrol project(any type of
project really), IDE creates a default usercontrol form
for us. Is there a way to set IDE so that instead of this
default form, It creates a custom form?
thanks Tag: protect my code from decompile Tag: 51992
Am I doing something wrong? (Variables)
Hiya all,
I am developing a windows form application. I am coding in C#. What I have
is two forms/Classes, frmMain & frmAdd and they both have the same default
namespace "Q.A._Testing_Centre". In frmMain I have initialize & instantiated
my variable as "public string userName", where the user input name is
stored. I am trying to get the stored data propertied from my frmMain to my
frmAdd. I thought this is the correct syntex for outputting the info in my
textbox (scratching my head), maybe it's not. So please let me know if you
can help, or where I'm going wrong. Code is as follows:
namespace Q.A._Testing_Centre
{
public class frmMain : System.Windows.Forms.Form
{
public string userName; <<<---- I want the data from here
...
...
...
namespace Q.A._Testing_Centre
{
public class frmAdd : System.Windows.Forms.Form
{
private void SubMainMenu()
{
frmMain Main = new frmMain();
txtBoxSample.Text = Convert.ToString(Main.userName);<<<--- to output in my
textbox here
...
...
...
I have tried a sample textbox with in frmMain and this data is in fact
stored until I exit my program. But I cannot seem to reproduce the same
textbox output in frmAdd. I seem to get a blank textbox area. Alternatively
I have try "txtBoxSample.Text = Main.userName" syntex which does not work as
well.
Or maybe if someone has a better alternative, please feel free to let me
know.
All help is truly appreciated & thank you all in advance.
MikeY Tag: protect my code from decompile Tag: 51989
Searching for folder Zip/Unzip utility.
I have tried alot in searching for API to make an utility
for zipping and unzipping the folders in vb.NET. If any
one has the idea to create this utility by using .net
framework please let me know.
regards
sandy Tag: protect my code from decompile Tag: 51982
list of mdi children in a submenu of mdiparent
Hello,
I would like to have a list of mdi children in a submenu of mdiparent.
the list should be refreshed dynamically when mdi children are created and
destroyed. mdi child should be activated when the user clicks the menu item.
I have some results but I am not satisfied (deep problems with
MdiChildActivate).
Maybe there's an article or an example on how to do that?
Regards,
Wiktor Tag: protect my code from decompile Tag: 51981
Component Errors
I am Intermediate VB Programmer. I develop an
application recently which I intend install on a server
network. But when I was testing software on the server, I
encountered a problem(ie when I tried to load the
application on the network from one of the client comptuer
(work-station). It was complaining of Some components
either missing or not properly registered. And these were
some of the component I used for the program such as
MSAdodc.Ocx... Inshort,some most of the activeX component
that I used.
Apart from developing a server and Client
Application,is there no other ways that can make this
applicatio work properly for me while application is on
server system and been accessed from the client computer?
I will be very grateful and thankful, if I can get
the solution right away.
Thanks Tag: protect my code from decompile Tag: 51976
Disable Ctl+Alt+Del C#
Dear Friends,
How to disable the start,windows task
manager,Ctl+Alt+Del buttons through C#?,
If any one knows please let me know...Any suggestions would be greatly
appreciated.
Thanks,
Dev Tag: protect my code from decompile Tag: 51975
DateTimePicker BackColor Property
Hi,
for those of you, who need a backcolored DateTimePicker
control:
this ist my implementation of the BackColor property for
the standard DateTimePicker Control (which does not work):
public class MyDateTimePicker : DateTimePicker
{
#region internal set backcolor hack
private Color _BackColor = SystemColors.Window;
public override Color BackColor
{
get
{
return _BackColor;
}
set
{
_BackColor = value;
Invalidate();
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == (int) 0x0014 /* WM_ERASEBKGND */)
{
Graphics g = Graphics.FromHdc(m.WParam);
g.FillRectangle(new SolidBrush(_BackColor),
ClientRectangle);
g.Dispose();
return;
}
base.WndProc(ref m);
}
#endregion
}
... seems to work quite well.
claudio Tag: protect my code from decompile Tag: 51969
Double Click on TreeView
Hi all,
I wanted to know if a node in tree view is double clicked,
I tried clicks property on MouseDown but it always returns 1.
any solutions for this problem
regards,
... Tag: protect my code from decompile Tag: 51966
Why this does not work?
Hi:
This is a little program. It has a thread that calls trough Invoke to a
method called Draw. The Draw method draw elements within the Panel control.
For some reason, the program does not close sometimes. Please semd me
comments about this.
Thanks!
Juan C. Olivares
// project created on 11-07-2003 at 0:31
using System;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace MyFormProject
{
delegate void DelegateCallDraw ();
class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel;
private DelegateCallDraw CallDraw;
public MainForm()
{
InitializeComponent();
panel.AutoScroll = true;
// Add controls
this.Draw ();
// Create delegate
CallDraw = new DelegateCallDraw (Draw);
// StartThread
Thread thread = new Thread (new ThreadStart (StartTimer));
thread.Start ();
}
// This method is used in the forms designer.
// Change this method on you own risk
void InitializeComponent() {
this.panel = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// panel
//
this.panel.Location = new System.Drawing.Point(16, 16);
this.panel.Name = "panel";
this.panel.Size = new System.Drawing.Size(264, 128);
this.panel.TabIndex = 0;
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 161);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.panel});
this.Name = "MainForm";
this.Text = "This is my form";
this.ResumeLayout(false);
}
private void Draw ()
{
panel.Controls.Clear ();
panel.SuspendLayout ();
for (int i = 1; i <= 20; i++) {
TextBox tb = new TextBox ();
tb.Text = i.ToString ();
tb.Location = new Point (0, (i - 1) * tb.Height);
panel.Controls.Add (tb);
}
panel.ResumeLayout ();
}
private void StartTimer ()
{
while (true) {
// Sleep 10 secs
Thread.Sleep (1000 * 10);
// Call draw
this.Invoke (this.CallDraw);
}
}
[STAThread]
public static void Main(string[] args)
{
Application.Run(new MainForm());
}
}
} Tag: protect my code from decompile Tag: 51964
Assign Property To ErrorProvider
I added an Error Provider to a VB.Net windows form called Err1. When I add
a text box to the form, I get a property called "Error on Err1" because I
added the Error Provider. How can I access this property in code to set a
value to it?
Derek Tag: protect my code from decompile Tag: 51954
ContextMenu will not close after mouse click
When the ContextMenu is associated to a control(Panel, Button...) on a
Windows Form, ContextMenu.Show() can popup the menu. But the menu
stays open after mouse click.
It worked perfectly on the form itself.
Any Idea? Tag: protect my code from decompile Tag: 51941
Is print preview in .NET wothwhile?
Hi!
I am preparing to write a small library for generating reports. One of
the key features is that it must support print previews. .NET has a
PreviewPrintControler but according to the docs it is keeping the whole
preview in Images. The library should be able to preview quite large
reports (over 100 pages) also on resource starving computers (like 64 MB
RAM 300 Mhz Celerons). Would PrintPreview eat the whole memory available
or does it have some optimizations to counter the problem? What are your
experiences?
Regards!
Micha³ Ziemski Tag: protect my code from decompile Tag: 51940
Odd problem with InputBox
hey all, I am having an odd problem with the InputBox in VB.NET, and it ONLY
happens on one of my computers. When I try "Dim x as String =
InputBox("TESTPROMPT"), I get the following error:
----------------------------------------------------------------------------
----
[Exception Details]
----------------------------------------------------------------------------
----
System.ComponentModel.Win32Exception: Class already exists
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
at NexGen.Environment.RaiseSpecialEvent(String& strAction, Object&
objSender) in Z:\Source Code\Presentation
Tier\VB.NET\NexGen.Environment\Environment.vb:line 73
at AMC.frmMain.frmMain_Load(Object sender, EventArgs e) in Z:\Source
Code\Presentation Tier\VB.NET\NexGen.AMC\frmMain.vb:line 2517
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)
any ideas?
TIA
Nick Jacobsen
njacobsen@pfastship.com Tag: protect my code from decompile Tag: 51932
Datagrid.Backgroundimage propertry (VB.NET)
How can I show an image in the background of the datagrid?
the Backgroundimage property has no effect....
tnx!
bill Tag: protect my code from decompile Tag: 51931
Having Property Grid Display Properties from the Most Derived Class
I would like to use the PropertyGrid control to allow users to edit the
properties of a control, however, I would like only the properties of the
most derived several classes to be visible.
How is this possible?
--
Howard Swope
Software Engineer
Spitz, Inc [http://www.spitzinc.com] Tag: protect my code from decompile Tag: 51928
Possible ToolBar bug
The following Form-derived class illustrates a problem I
am having when a ToolBar is instanced at the bottom of a
Form with a simple Panel at the top. When this form is
minimized and then restored, the layout logic leaves the
Panel not fully occupying the available client area. The
amount of dead space at below the panel depends on the
number of buttons instanced on the ToolBar. If no buttons
are used, the layout is correct.
Any ideas?
==============Form1.cs===================================
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ToolBar
toolBar1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolBarButton
toolBarButton1;
private System.Windows.Forms.ToolBarButton
toolBarButton2;
private System.Windows.Forms.ToolBarButton
toolBarButton3;
private System.Windows.Forms.ToolBarButton
toolBarButton4;
private System.Windows.Forms.ToolBarButton
toolBarButton5;
private System.Windows.Forms.ToolBarButton
toolBarButton6;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container
components = null;
public Form1()
{
//
// Required for Windows Form
Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code
after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool
disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose
();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated
code
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
this.toolBar1 = new
System.Windows.Forms.ToolBar();
this.panel1 = new
System.Windows.Forms.Panel();
this.toolBarButton1 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new
System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new
System.Windows.Forms.ToolBarButton();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new
System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5,
this.toolBarButton6});
this.toolBar1.Dock =
System.Windows.Forms.DockStyle.Bottom;
this.toolBar1.DropDownArrows =
true;
this.toolBar1.Location = new
System.Drawing.Point(0, 407);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new
System.Drawing.Size(696, 28);
this.toolBar1.TabIndex = 0;
//
// panel1
//
this.panel1.BackColor =
System.Drawing.SystemColors.Info;
this.panel1.Dock =
System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new
System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new
System.Drawing.Size(696, 407);
this.panel1.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.ClientSize = new
System.Drawing.Size(696, 435);
this.Controls.Add(this.panel1);
this.Controls.Add(this.toolBar1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the
application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
} Tag: protect my code from decompile Tag: 51927
Win98: DragDrop registration fails everytime
I'm ripping a thread that I created a few days ago, since I used the
exact same subject line as a previous one.
In addition, I can also say that since I posted this thread, I've come
to the conclusion that this application is hitting some sort of wall
with regards to Window handles. I'm leaning towards this being one of
the primary issues because when a user selects a "tool" from a Form
(it launches the core application, which is quite large), you can
immediately kill the Form, go back to the tool selection Form...select
it again, and it will _always_ fail to load the 2nd time. The
application just dies.
Furthermore, I've got try/catch blocks all over the place, sending the
Exceptions to a logfile, and nothing ever gets logged once it gets in
this state. You're forced to do the ole' Win98 CTRL-ALT-DEL at that
point.
So, the question is this: If I'm correct (or partially) in that Window
handles might be the culprit, how do I resolve it? I spent an entire
day forcing dispose() on everything I could possibly think of, as well
as using things like the Performance Counters to identify problematic
(meaning, resource hungry) classes, and I still get the same result...
Can anybody (Microsoft?) help or even give me some kind of direction?
Here's the original post...
-----------------------------------------------------------
I have a C# Application that is posing some interesting issues when
run within Win98. Let me preface this by saying that everything works
like a charm under Win2000.
Anyhow, the current issue is that under "certain" circumstances
(there's no logic as to how/why this happens), you will fire up this
application under Win98 and get a "DragDrop Error: registration
failed" MessageBox from JIT.
The source code line in question is, of course, a simple
"this.AllowDrop = true;" property. If I were to remove it, the problem
would go away. Of course, I need that call in order for the
application to function correctly.
And before anybody asks the obvious, I _do_ have the following line in
my main Form:
[STAThread]
static void Main(string[] args)
I can't really make heads or tails out of this issue, and it
definitely presents itself only under Win98.
This particular Win98 machine is up to scratch, in terms of
patches/updates/etc. The OS has IE6.0 installed, as well as .NET
runtime v1.1. The Application is compiled using .NET Studio 2003.
Can anybody shed any light on this? Any workarounds? Tag: protect my code from decompile Tag: 51926
User control shows error
hi,
I have a Windows Form (in VB.NET) with a panel that
includes a User Control that I have made.
It used to work fine, but now, I have the following
problem:
The programs compiles and works fine.
But when I look at the form in DESIGN VIEW,
it does not display the UserControl, but the following
error message: Object Reference not set to an instance of
an object.
Any idea why I have this???
thanks,
Ross Tag: protect my code from decompile Tag: 51919
Inherited Forms Lose Tab Order
1.) Create a form with a tabcontrol.
2.) Change the modifier of the tab control to "protected"
3.) Add 1 tab to the tab control.
4.) Create a second form that inherits from the first.
5.) On the new form, add a 2nd tab to the inherited tab
control.
6.) Swap the order of the tabs so the new tab occurs first.
7.) Save and close the forms. Re-open the 2nd one.
Notice the tab order was not preserved.
Bug? Workaround? Tag: protect my code from decompile Tag: 51918
CustomEditor on collection for a component
I'm trying to use a custom editor for a property in a
component. The custom editor shows a dialog. It appears
the custom editor is not calling the SET property when its
done. I've tested this with other samples and it does
there. Could this have anything to do with the fact that
the type of the property is an ArrayList?
Bill Tag: protect my code from decompile Tag: 51917
Setting Application directory as path for database.
I want to set my application's database path to the
directory that the application resides in so that any
location I install this application will look to the
installation directory, instead of where I have the file
located on my system. (ie C:\Documents and
Folders\Users\Current User...)
I am setting this at design time using the properties
window for the OleDb connection. Can I do this? If not how
do I do it? Tag: protect my code from decompile Tag: 51906
Validation + Malicious input
Hello All,
I am currently developing a windows form which transacts
data with a database, using web services.
These transactions are the heart of the application, as
98% of the tasks allowed on the UI bind to the web service.
Due to the implicit need of assuring the user does not
enter wrong data (SQL Data Types) or INJECTS malicious
code, where can I find good information on windows forms
data validation->(priority 1) and avoiding malicious code
avoidance->(priority 2)?
- The big question is: is there something like a
asp:InputValidator on WindowsForms, or do I have to deal
with it down to the nitty gritty?
Thanks for all the replies, any resources are welcome
Francisco Tag: protect my code from decompile Tag: 51904
How to handle System menu messages?
I have a MDI Parent in which I display a dialog box. When user minimize the
dialog I want the whole MDI window to be minimized.
Your help greatly apreciated.
Thanks,
Hemanshu Tag: protect my code from decompile Tag: 51889
hi.
how to protect my vb.net application , from decompile ?
all the tips , softwares, we be nice to read about.