|
Hi,
afaik the Handle of each window is unique. Everything (visual) has a handle.
|
|
|
|
|
Thanks mikone for the reply, but I have come across certain Win Forms where the Handle of the control changes each time I call the Application. For eg. I bring up Calculator (here it is same just for eg. sake) each time the handle for the button 7 may not be same. I am not sure if the forms are .NET forms. They could be VC based Win Forms, that is what somebody had told me. Thanks again.
With Regards
Anoop.
|
|
|
|
|
I've got a little problem, i've got one threaded class setting up all parameters and finially showing a MSN-Lookalike PopUp window, with a sliding effect. the problem is, the popup only slides 1 or 2px then it gets stuck. Calling the function within the class without using a thread causes no problem and it's shown as it's supposed to. Could anyone help me out or give me a hint ? please
class PopUpHandler<br />
{<br />
private string popTitle;<br />
private string popContent;<br />
TaskbarNotifier taskbarNotifier;<br />
public PopUpHandler(string strTitle, string strContent)<br />
{<br />
popTitle = strTitle;<br />
popContent = strContent;<br />
Thread popUpThread = new Thread(new ThreadStart(popupShowMessage));<br />
popUpThread.Start();<br />
}<br />
public void popupShowMessage()
{<br />
System.Reflection.Assembly myAssembly = this.GetType().Assembly;<br />
<br />
ResourceManager myManager = new ResourceManager("SystemTray.Form1", myAssembly);<br />
<br />
taskbarNotifier = new TaskbarNotifier();<br />
taskbarNotifier.SetBackgroundBitmap((Bitmap)Properties.Resources.imageSkin, Color.FromArgb(255, 0, 255));<br />
taskbarNotifier.SetCloseBitmap((Bitmap)Properties.Resources.imageClose, Color.FromArgb(255, 0, 255), new Point(127, 8));<br />
taskbarNotifier.TitleRectangle = new Rectangle(40, 9, 80, 25);<br />
taskbarNotifier.ContentRectangle = new Rectangle(8, 41, 133, 68);<br />
taskbarNotifier.Show(popTitle, popContent, 500, 4000, 50);<br />
}<br />
}
|
|
|
|
|
I want to create an object. Its background is transparent (it shows underground object). And it shows any Text like Label Control.
How can i do it?
|
|
|
|
|
Derive a class from Label. Put this in the constructor:
SetStyle(ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor, true);
You can set the background to Color.Transparent if you like, but it doesn't matter. If you write a Paint handler that renders the text only, you'll have what you want.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If you want a whole form to be transparent (but not its content) you could set its transperency key to a color you will NEVER use for anything else but the forms background color.
<br />
this.BackColor = Color.FromArgb(255,2,3,4);<br />
this.TransparencyKey = Color.FromArgb(255,2,3,4);<br />
this would make the form invisible.
To create transperent controls see the comment before this one
|
|
|
|
|
I create a picture. It has an image. And i put a label on it. I want the backcolor of the label is invisible. It shows only text.
In Vb 6.0, i can do it. If i set the label's backcolor is transparent. It doesn't show the backcolor.
Your response doesn't do what i want
|
|
|
|
|
i understood you correctly. i told you to have a look for the former comment on how to make CONTROLS (like your label) transparent. you have to derive it, add a function call to the constructor and override the onpaint method of the base class.
|
|
|
|
|
Dear mikone
Whould you please write a sample code about Transparenting Label and overwriting OnPaint
|
|
|
|
|
Hi
Dear programs..
how can i save utf-8 format characters to database
for example
تا زا
saved to data base
and when recieved i get ???????
which class encode it and decode it
sikandar
|
|
|
|
|
Keep it in the same thread instead of starting another.
---
b { font-weight: normal; }
|
|
|
|
|
You should choose Type of fields in database "nVarchar Or ntext".
|
|
|
|
|
You should choose Type of fields in database "nVarchar Or ntext".
this is not working
sikandar
|
|
|
|
|
Hi,
New to the forum, and new to C#, so apologies for appearing a bit, er new to all of this!
I have a large CSV file that I want breaking down into smaller ones. So if I have, say 1500 records in it, I want it split up per 1000, i.e. the first CSV file will have 1000 records in and the second one has 500. I've tried searching for this and can find a few examples of reading CSV files (not that I understand many of them!), but can't seem to find anything that does what I want. Can anybody help me please?
Thank you to anyone who does.
|
|
|
|
|
Something that might make this clearer:
I guess if I could read the files I could do a for-loop to check how many records there were, then save to a new file once it reaches 1000. So I'm not sure about reading them and don't know how to output them to a file. Hope this helps!
|
|
|
|
|
a CSV file is just plain text (open one in Notepad to see), so all you need to do is read the text file, and dump out the lines to new files
pseudocode:
OPEN input.csv
OPEN output1.csv
OPEN output2.csv
header = input.GETLINE
output1.WRITELINE(header)
output2.WRITELINE(header)
line = 0;
WHILE ( line < 1000 & !input.EOF )
row = input.GETLINE
output1.WRITELINE(row)
line++
ENDWHILE
output1.CLOSE
WHILE( !input.EOF )
row = input.getline
output2.WRITELINE(row)
ENDWHILE
output2.CLOSE
input.CLOSE
|
|
|
|
|
There is one exception: CSV doesnt say ANYTHING about whats in there. So, there actually might be headers in the first line of the file.
If thats the case, you will want to read the first line seperately, store it, and write it to ALL output files before starting to distribute the other entries.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Thanks for your help benjymous.
I have tried working through this, but no success yet; I know it is a basic thing I am missing, but not sure what. The code I have so far is:
using System;
using System.Collections;
using System.IO;
using System.Text;
public class CSVReader
{
// Open the files to write to
string fileName = @"C:\data\Test Data\Test\CIS_KASN.txt";
string textLine;
int row = 1;
}
public CSVReader(string fileName)
{
StreamReader fileReader = File.OpenText(fileName);
StreamWriter fileWriter1 = File.CreateText(@"C:data\Test Data\Test\Output1 CIS_KASN.txt");
StreamWriter fileWriter2 = File.CreateText(@"C:data\Test Data\Test\Output2 CIS_KASN.txt");
while ((textLine = fileReader.ReadLine()) != null && row <= 1000)
{
// Write to output file
fileWriter1.WriteLine(textLine);
row++;
}
fileWriter1.Close();
while ((textLine = fileReader.ReadLine()) != null & row > 1000)
{
// Write to output file
fileWriter2.WriteLine(textLine);
}
fileWriter2.Close();
}
Does this make much sense?
Also, point taken about the header; I'll work that part out when I get the main part working!
Thanks all.
|
|
|
|
|
I'm just curious what is the root cause of having to break up the CSV?
|
|
|
|
|
Another programme has been written that only allows CSV files of 1000 records per go. I don't know what it's been written in etc, but suffice to say it will take a long time for that side of things to be changed; this is seen as quicker. So any help is much appreciated!
|
|
|
|
|
Salam
how can i save uft-8 format characters to database
is there is any method or technique that convert uft-8 to normal and then reencode it.
in c#
sikandar
|
|
|
|
|
C# ha a number of classes for converting between text encodings. Is UFT-8 the same as ASCII ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
if i save نام
this world to data base when i retrieve i get ?????
how can i get the origninal
sikandar
|
|
|
|
|
UTF-8 is an encoding, and you don't save encoded text to the database.
Use a unicode data type. In SQL Server, for example, the unicode data types are named nvarchar and ntext .
---
b { font-weight: normal; }
|
|
|
|
|