|
HI!
You can create a window and change the property "FormBorderStyle" to "None" and load the image file to the "BackgroundImage"-property. Then, for the next formulars you want to use it as a forumlar, you just need to inherit it. Just click right on the project-explorer (sorry, have the german version; dunno if it is correct translation for the english version) on the project and select "Add..." and "Add inherited formular". There you will be able to select one of your windows and the window will be inherited from the one you selected. If you make changes to the original formular, you need to recompile it before you see changes to the inherited formulars.
Marcel Erz
|
|
|
|
|
Hi Marcel,
Thanks for the reply.
That would be surely be a lot of help
But, i am not able to understand the meaning of "formular". Does it mean the window form that you are creating (i.e. the template given, on which you drag-drop the controls, when a new windows application is created). Well, i just searched google for that word and found that "formular" means "form".Quite near, i think. I hope i got it correct.
I mean, if you could tell me where exactly you get it, i'll be able to understand it better.
But, thanks again. I can start exploring from here.
Thanks a lot.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Yes, form is an abbrevation of formular. So, if someone say forular.. that means form. If you need more help in this, let me know!
Marcel Erz
|
|
|
|
|
Sure Marcel,
I'll surely contact you, if i require any help.
Thanks a lot.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Hi Marcel,
I started making the program.
However, the issue that i have found is that, if the window size increases (which i think is bound to happen due to dynamic resizing), then the background image repeats.
To prevent this, i have put a Picture Box object in the main window and with my image(a png image) as its source. The image has rounded corners and has some transparency itself. But, somehow, i am unable to find a combination of colors for the form and the Picture Box object to display just the exact image with the background transparent.
Can you tell me how to deal with this?
Also, any idea, how to get the system menu for the dialog.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Hi friends,
When i open a TextFile(csv) using StreamReader,is it possible to get its schema too....?
Or is there any other method to get the schema of a textfile(other than Oledb)?
Thanx....
|
|
|
|
|
Hi!
What do you mean by schema? You have the extansion, so you know it is a CSV when it is an CSV-extension.
So, if you mean how to get the data from a CSV, then look at this:
<br />
string lsData = "";<br />
string[] lsStrArray = null;<br />
<br />
System.IO.StreamReader loStream = new System.IO.StreamReader("C:\\test.csv"); <br />
<br />
while ((lsData = loStream.ReadLine()) != null)<br />
{<br />
lsData = loStream.ReadLine();<br />
lsStrArray = lsData.Split(';');<br />
}<br />
loStream.Close();<br />
Marcel Erz
|
|
|
|
|
HI friend,
Schema--Wat i mean by this word is the structure of the TextFile..
That includes the delimeters,the textqualifiers,datatype....
My job is to transfer textfile to access...So only if i know the schema ,i can successfully run the transfer...Schema is also essential when Textfile is transfered to another Textfile itself.....
Cud u get me?
Help me...Thanx.....
|
|
|
|
|
Hi!
Now I know what you mean!
If you are using a CSV, you just can have some headers, which are not really readable for computer processing, coz they are just normal string and they dont show what datatype it is.
If you need more information about every field, you should use XML! There, you can descrbe every fields datatype, additional descriptions and so on!
For a normal textfile you cannot find out the schema! You need to know how the structure of the file is.
Marcel Erz
|
|
|
|
|
Thanx Marc...
Cud me tell me in codes how to do it with XML?
'Coz i know only little about XML....
|
|
|
|
|
|
How to send a simple text message to a specified tcp port using C#?
many thanx in advanced.
|
|
|
|
|
Hi!
If you want to send a message with TCP to a special port: that is not really so easy, coz you have first to establish the connection. UDP is easier, coz it is connectionless and you can directly send it to the port. Anyway! Here a short description about TCP:
<br />
System.Net.Sockets.TcpClient loTcp = new System.Net.Sockets.TcpClient();<br />
<br />
try {<br />
<br />
loTcp.Connect("127.0.0.1", 80);
System.Net.Sockets.NetworkStream loStream = loTcp.GetStream();
<br />
Byte[] lbOutData = System.Text.Encoding.ASCII.GetBytes("This is a text message!");<br />
<br />
loStream.Write(lbOutData, 0, lbOutData.Length);
<br />
loTcp.Close();
<br />
} catch (Exception loErr) {<br />
MessageBox.Show("Network error: " + loErr.ToString());
}<br />
for UDP the following code can be used:
<br />
Byte[] lbOutData = System.Text.Encoding.ASCII.GetBytes("This is a text message!");<br />
System.Net.Sockets.UdpClient loUdp = new System.Net.Sockets.UdpClient();<br />
<br />
try <br />
{<br />
loUdp.Send(lbOutData, lbOutData.Length, "127.0.0.1", 80);<br />
} <br />
catch (Exception loErr) <br />
{<br />
MessageBox.Show("Network error: " + loErr.ToString());<br />
}<br />
Marcel Erz
|
|
|
|
|
Hi friends,
Am having a grid with TextBoxColumn in it..There a combo is placed for selecting the value for the textboxcolumn...
My Grid looks more like a table in the design view of MS Access..
Similarly,there are 3 columns ..one for FieldName,sec for Datatype and third for description...
In Access,when we select the datatype from the dropdown list and move to the next row,the datatype wont change even if we move through various rows up and down..
In my appln,after selecting and moving to the next row,and again back to the prev row(to tht part col),the selected text in the combo changes to that row(tht col) from which v r moving..
Kindly help me...
Thanx...
|
|
|
|
|
I have played with generics and I have one question.
Take this simple sample:
<code>
using System;
using System.Collections.Generic;
using System.Text;
namespace FunnyTests
{
public class Funny<T>
{
private T _value;
public T Value
{
get { return _value;}
set { _value = value;}
}
}
class Program
{
static void Main(string[] args)
{
Funny<int> someInt = new Funny<int>();
someInt.Value = 10;
Funny<string> someString = new Funny<string>();
someString.Value = "Test";
// *************************************************
// List<Funny> myFunnyList = new List<Funny>();
// *************************************************
List<Funny<int>> myFunnyIntList = new List<Funny<int>>();
List<Funny<string>> myFunnyStringList = new List<Funny<string>>();
}
}
}
</code>
Well, I wish one List of Funny objects (independent of T is string, integer, etc.), but with the code above I can't. The commented code is what I wish, and the another 2 is what I can do.
Resuming: I can have only lists of (by example) <code>Funny<int></code> objects or <code>Funny<string></code> objects, but not "Funny" objects...
Someone have sugestions?
Thanks for all
-- modified at 23:09 Tuesday 13th December, 2005
|
|
|
|
|
A generic object is in fact a class factory. Funny<string> and Funny<int> are two different classes. Therefore, the only way to do this is with a collection of objects, or if you create a new class heirarchy, where each derived class contains a Funny with a different template argument.
But if you do that, the code to get at those objects will be pretty ugly.
Christian Graus - Microsoft MVP - C++
-- modified at 23:15 Tuesday 13th December, 2005
|
|
|
|
|
|
Hi folks,
I have just started trying to do some basic graphics using the Graphics Class. I found an excellent tutorial on CodeProject about making a scrolling window with graphics in it and implemented it with no problems within my code. I then wanted to add a Scaling Function using the PageScale feature, but now the scrolling stops working reliably and I get a jagged pictures with parts printed all over the screen.
I've written a short piece of code to show this problem - if you make the pagescale value 1.0F then everything works fine, any other values result in a mess...
Thanks for any advice...
<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
namespace scrollfailure<br />
{<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
private System.ComponentModel.Container components = null;<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
protected override void Dispose( bool disposing )<br />
{<br />
if( disposing )<br />
{if (components != null) { components.Dispose(); }<br />
}base.Dispose( disposing );<br />
}<br />
<br />
#region Windows Form Designer generated code<br />
private void InitializeComponent()<br />
{<br />
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);<br />
this.AutoScroll = true;<br />
this.AutoScrollMinSize = new System.Drawing.Size(600, 600);<br />
this.ClientSize = new System.Drawing.Size(275, 249);<br />
this.Name = "Form1";<br />
this.Text = "Form1";<br />
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);<br />
}<br />
#endregion<br />
[STAThread]<br />
static void Main() <br />
{<br />
Application.Run(new Form1());<br />
}<br />
private Point rectangleTopLeft = new Point(45, 45);<br />
private Size rectangleSize = new Size(200,200);<br />
private Point ellipseTopLeft = new Point(50, 200);<br />
private Size ellipseSize = new Size(200, 150);<br />
private Pen bluePen = new Pen(Color.Blue, 1);<br />
private Pen redPen = new Pen(Color.Red, 1);<br />
<br />
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
{<br />
<br />
Graphics dc = e.Graphics;<br />
dc.PageScale = 2.0F;
Size ScrollOffset = new Size(this.AutoScrollPosition);<br />
<br />
Rectangle RectangleArea = new Rectangle<br />
(rectangleTopLeft+ScrollOffset, rectangleSize);<br />
Rectangle EllipseArea = new Rectangle<br />
(ellipseTopLeft+ScrollOffset, ellipseSize);<br />
dc.DrawRectangle(bluePen, RectangleArea);<br />
dc.DrawEllipse(redPen, EllipseArea);<br />
<br />
}<br />
}<br />
}<br />
<br />
|
|
|
|
|
Hello I am new to C# and am having a heck of a time making a program work. I am accessing an Oracle database and want to run a query that compares a local variable to the results of the query. I also would like to pass in a local variable in the SQL statement. Is this possible? Here is my SQL statement...
SELECT t.store `store`, MAX(t.tax_rate) `tax` FROM finapps.tax_rate_main t WHERE t.store = " + storeNum + "GROUP BYstore"
The variable "storeNum" is a string and I would like to compare it to the results of the store column and only return 1 value.
I created a windows form application and when the user enters in a store number it compares it to a list of stores in the database with a corresponding tax rate. I want to return the tax rate...
Please help!
Apoc
|
|
|
|
|
apoc503 wrote: SELECT t.store `store`, MAX(t.tax_rate) `tax` FROM finapps.tax_rate_main t WHERE t.store = " + storeNum + "GROUP BYstore"
If storeNum is a string ( I assume it's not, in the database I mean ), you need to put quotes around it. Either way, you need a space before 'GROUP' and after BY, surely ?
Are you having trouble connecting to ORacle at all ? If so, a google of 'Oracle C#' will give you heaps of examples.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I finally got it to work.
conn.Open();<br />
OracleCommand cmd = new OracleCommand();<br />
cmd.Connection = conn;<br />
cmd.CommandText = "SELECT MAX(tax_rate) tax FROM finapps.tax_rate_main t WHERE store = '" + storeNum + "'" ;<br />
cmd.CommandType = CommandType.Text;<br />
<br />
OracleDataReader dr = cmd.ExecuteReader();<br />
dr.Read();<br />
<br />
getTax = Convert.ToString(dr.GetOracleNumber(0));<br />
taxRate = Convert.ToDecimal(getTax);
Oracle was a good place to look...Thanks..
Apoc
|
|
|
|
|
hello,
i a new to C# and i am trying to figure it out! In C++ when adding a class to communicate with a db u add a class and select ODBC Consumer....
How do u add a class like above for C#? Can someone walk me through the steps in vs .net 2003?
thanks,
Lino
|
|
|
|
|
In C++, you were able to use a base class to write a class that was tied to a database. In C#, it does not work that way. A google of 'oledb C#' got me a lot of hits that looked useful, including this[^]
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
I am using a dataview to filter a dataset.
At first the datagrid is populated with 9 records. This is without a filter.
Then I check a checkbox to filter the dataset. This then returns 1 record in the datagrid.
Then I uncheck the checkbox and really I want the datagrid to be populated with the initial 9 records but it only populates with just the one as if the filter checkbox is checked. But the count on the dataset at this stage returns 9 and not 1.
if a dataset is filtered, then how do I get the initial number of records in the dataset (i.e. prior to filtering)?
Any thoughts please?
Thanks
|
|
|
|
|