16,004,587 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Sid_Joshi (Top 129 by date)
Sid_Joshi
13-Feb-19 5:26am
View
which dlls? can you provide list?
Sid_Joshi
13-Jun-18 7:38am
View
No sir i dnt have 64bit pc. I am working on win 10 32 bit system only.
Sid_Joshi
13-Jun-18 7:28am
View
added in question. dll and exe built at win 10 are working fine at win xp but not at win 10. whats d issue, did I missed something?
Sid_Joshi
13-Jun-18 7:25am
View
no sir, I am working on 32 bit system and not 64bit.
Sid_Joshi
13-Jun-18 2:42am
View
At frmReportViewer.Show 1 form gets this error.
this form have crystal report viewer control.
How can I share code with you?
Sid_Joshi
18-Dec-15 1:02am
View
Don't barcode in bitmap. Use IDAutomationHC39M.ttf font for storing Barcode and varchar datatype in database.
Sid_Joshi
10-Nov-15 1:15am
View
Thank You OriginalGriff 5 Votes (y)
Sid_Joshi
17-Jun-15 7:36am
View
Reason for my vote of 5 \n Good
Sid_Joshi
20-May-15 9:21am
View
sidjoshi12@gmail.com
Sid_Joshi
20-May-15 7:42am
View
mail me ur project
Sid_Joshi
20-May-15 7:14am
View
chk ur crystal report's sql query in sql management studio.
Sid_Joshi
20-May-15 6:44am
View
string Reportdoc = Server.MapPath("") + "\\SoldCrystalReport.rpt"
concentrate on .rpt
Sid_Joshi
20-May-15 6:31am
View
<form id="form1" runat="server">
<div>
<asp:Button ID="btnShowReport" runat="server" onclick="btnShowReport_Click" Text="Show Report" /><br />
<input type="button" value="Print" />
</div>
<div id="DivReportVIew" runat="server">
</div>
</form>
Sid_Joshi
20-May-15 6:03am
View
did u changed PrintClientBrokerageSum.rpt to ur report file name
and DataTable filled with data or not?
Sid_Joshi
20-May-15 5:48am
View
protected void btnShowReport_Click(object sender, System.EventArgs e)
{
System.Data.DataTable dt = new System.Data.DataTable();
string Reportdoc = Server.MapPath("") + "\\RPT\\PrintClientBrokerageSum.rpt";
CrystalDecisions.CrystalReports.Engine.ReportDocument orpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
orpt.Load(Reportdoc);
orpt.SetDataSource(dt);
System.IO.Stream ReportStream = orpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.HTML40);
byte[] bytes = new byte[ReportStream.Length + 1];
ReportStream.Position = 0;
ReportStream.Read(bytes, 0, (int)ReportStream.Length);
orpt.Dispose();
DivReportVIew.InnerHtml = System.Text.Encoding.UTF8.GetString(bytes);
bytes = null;
ReportStream.Flush();
ReportStream.Dispose();
printsetting();
}
public void printsetting()
{
string key = "script3";
Type cstype = this.GetType();
string script = "<script type=\"text/javascript\"> \n function printDivnew(divID) { \n"
+ "//Get the HTML of div \n"
+ "var divElements = document.getElementById(divID).innerHTML; \n"
+ "//Get the HTML of whole page \n"
+ "var oldPage = document.body.innerHTML;\n"
+ "//Reset the page's HTML with div's HTML only \n"
+ "document.body.innerHTML =\n"
+ "\"<html><head><title></title></head><body>\" \n"
+ "divElements + \"</body>\"; \n"
+ "//Print Page \n"
+ "window.print();\n"
+ "//Restore orignal HTML \n"
+ "document.body.innerHTML = oldPage;\n"
+ "}" + "</script>";
//ClientScript.RegisterStartupScript(cstype, key, script)
this.ClientScript.RegisterStartupScript(cstype, key, script);
}
Sid_Joshi
20-May-15 5:35am
View
use http://converter.telerik.com/ to convert code
Sid_Joshi
20-May-15 5:13am
View
<div>
<asp:Button ID="btnShowReport" runat="server" Text="Show Report" /><br />
<input type="button" value="Print" />
</div>
<div id="DivReportVIew" runat="server">
</div>
Protected Sub btnShowReport_Click(sender As Object, e As System.EventArgs) Handles btnShowReport.Click
Dim dt As New System.Data.DataTable
Dim Reportdoc As String = Server.MapPath("") & "\RPT\PrintClientBrokerageSum.rpt"
Dim orpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
orpt.Load(Reportdoc)
orpt.SetDataSource(dt)
Dim ReportStream As System.IO.Stream = orpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.HTML40)
Dim bytes(ReportStream.Length) As Byte
ReportStream.Position = 0
ReportStream.Read(bytes, 0, ReportStream.Length)
orpt.Dispose()
DivReportVIew.InnerHtml = Encoding.UTF8.GetString(bytes)
Erase bytes
ReportStream.Flush()
ReportStream.Dispose()
printsetting()
End Sub
Public Sub printsetting()
Dim key As String = "script3"
Dim cstype As Type = Me.GetType()
Dim script As String = "<script type=""text/javascript"">" & vbCrLf _
+ "function printDivnew(divID) {" & vbCrLf _
+ "//Get the HTML of div" & vbCrLf _
+ "var divElements = document.getElementById(divID).innerHTML;" & vbCrLf _
+ "//Get the HTML of whole page" & vbCrLf _
+ "var oldPage = document.body.innerHTML;" & vbCrLf _
+ "//Reset the page's HTML with div's HTML only" & vbCrLf _
+ "document.body.innerHTML =" & vbCrLf _
+ """<html><head><title></title></head><body>""" & vbCrLf _
+ "divElements + ""</body>"";" & vbCrLf _
+ "//Print Page" & vbCrLf _
+ "window.print();" & vbCrLf _
+ "//Restore orignal HTML" & vbCrLf _
+ "document.body.innerHTML = oldPage;" & vbCrLf _
+ "}" & vbCrLf _
+ "</script>"
'ClientScript.RegisterStartupScript(cstype, key, script)
Me.ClientScript.RegisterStartupScript(cstype, key, script)
End Sub
Sid_Joshi
20-May-15 4:38am
View
my code will shows crystal report in DivReportVIew and print this div
without crystal report viewr
keep DivReportVIew empty at design time
crystal report will display in this div at run time.
Sid_Joshi
20-May-15 4:04am
View
<div id="DivReportVIew" runat="server">
</div>
add this to your aspx code
the above code will convert crystal report in html text and populates in DivReportVIew div and first code will print div contained html text.
Sid_Joshi
20-May-15 3:49am
View
use this to convert crystal report in html text in a div.
Reportdoc.Value = Server.MapPath("") & "\RPT\PrintClientBrokerageSum.rpt"
Dim orpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
'Dim reporturl As String = ""
'reporturl = UCase(Mid(rEPORTfILE, rEPORTfILE.LastIndexOf("\") + 2, rEPORTfILE.Length).ToUpper())
orpt.Load(Reportdoc.Value)
orpt.SetDataSource(DtMain)
Dim ReportStream As System.IO.Stream = orpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.HTML40)
Dim bytes(ReportStream.Length) As Byte
ReportStream.Position = 0
ReportStream.Read(bytes, 0, ReportStream.Length)
orpt.Dispose()
DivReportVIew.InnerHtml = Encoding.UTF8.GetString(bytes)
Erase bytes
ReportStream.Flush()
ReportStream.Dispose()
and replace divID with DivReportVIew at above code
Sid_Joshi
18-May-15 3:17am
View
Document DOC=getDomElement(line);
Node n = DOC.getFirstChild();
NodeList nl = n.getChildNodes();
Node row,col;
for (int i=1; i < nl.getLength(); i++) {
row = nl.item(i);
// System.out.println(row.getNodeName());
NodeList list=row.getChildNodes();
for (int j=0; j < list.getLength(); j++){
col = list.item(j);
System.out.println(col.getNodeName()+"="+getElementValue(col));
}
System.out.println("-----------------------------------------------------");
}
Sid_Joshi
9-May-15 6:59am
View
Deleted
did you defined
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
before
Connection conn=DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=TestJava;user=testjava;password=ahmad");
Sid_Joshi
9-May-15 6:43am
View
What you wants to do?
Sid_Joshi
28-Apr-15 3:44am
View
Thank you
I changed my code if(!pv_ForeColor.IsEmpty)
and if (_Alignment != TableViewerCell.Text_Align.Left)
according to your solution..
Thank You Again....
Sid_Joshi
28-Apr-15 2:56am
View
then what condition i should use in c# for
if (c != null) and
if (Alignment != null)?
Sid_Joshi
25-Mar-15 8:20am
View
I Wants to transfer text data and images.
Sid_Joshi
25-Mar-15 1:46am
View
No needs to change any setting in emulator. just use http://10.0.2.2:8083/MyService.svc/Login?UserName=admin&Password=ace
Sid_Joshi
19-Mar-15 1:40am
View
127.0.0.1 is the device's own loopback interface. to access development machine's localhost use 10.0.2.2.
Sid_Joshi
18-Mar-15 3:33am
View
That's good practice.
Sid_Joshi
17-Mar-15 9:23am
View
Sorry, but I described this in comment. don't worry I will solve this problem.
Sid_Joshi
17-Mar-15 9:15am
View
Your solution is correct Mr. Maciej Los. but in my case xml string will came from web service and it will available in String format and not xml resource.
Sid_Joshi
17-Mar-15 2:10am
View
I want to parse this data at android not .net
String[]a={"apple","banana","mango","lemon"};
ListView lv=(ListView)findViewById(R.id.listView1);
ArrayAdapter<string> mya=new ArrayAdapter<string>(getApplicationContext(), android.R.layout.simple_list_item_1, a);
lv.setAdapter(mya);
this manner.
Sid_Joshi
16-Mar-15 8:53am
View
--- content has been moved to the question ---
Maciej Los
Sid_Joshi
16-Mar-15 8:33am
View
I want to transfer data from server to android app.
Sid_Joshi
16-Mar-15 4:15am
View
https://www.dropbox.com/s/kg1cqjnbwpc6972/Crystal.zip?dl=0
Sid_Joshi
13-Mar-15 2:44am
View
Thank you for your Replay, but I fixed this prob by changing target framework to x86 and works fine.
Sid_Joshi
24-Jan-15 6:20am
View
Drag your image field on crystal report from Field Explorer->DataBase Field->Table Name->column Name
Sid_Joshi
24-Jan-15 5:35am
View
check
imgdata = (byte[])dt.Rows[0][0];
second [0] is the column index. use proper index for image column
Sid_Joshi
24-Jan-15 5:07am
View
where you got error?
at crystal report or showing image at pictureBox2?
Sid_Joshi
24-Jan-15 4:55am
View
what data type are u using?
use Image Data type for storing image at sql server
Sid_Joshi
24-Jan-15 2:10am
View
change data type to image and change all code ie. used to save and retrieve image at front end.
Sid_Joshi
19-Jan-15 4:47am
View
this update query works fine at other places except in while loop
Sid_Joshi
19-Jan-15 4:42am
View
12
3
4
code transmits Sqlite data to sql server via asp.net app
Sid_Joshi
19-Jan-15 4:39am
View
Yes
Sid_Joshi
15-Jan-15 7:20am
View
Thank you for replay sir.
I think it's a useless feature.
Sid_Joshi
15-Jan-15 7:04am
View
still It doesn't work.
Sid_Joshi
15-Jan-15 4:52am
View
Reason for my vote of 5 \n Usefull Trick
Sid_Joshi
15-Jan-15 1:09am
View
Reason for my vote of 5 \n Very Useful information.
Sid_Joshi
8-Jan-15 4:21am
View
Use varchar(max) data type.
If you want to use image data type, the code will be different.
replay me if u want image data type
Sid_Joshi
8-Jan-15 0:57am
View
What Data Type U used in sql server database?
and at which line shows error you described?
Sid_Joshi
31-Dec-14 0:56am
View
create table in string html variable in html format and write this html text on web page it will looks like a web page
Sid_Joshi
26-Dec-14 1:06am
View
open ojbject explorer->right click on table->Design->select RefrenceNo column->expand identity specification node from column properties tab change is identity to Yes
Sid_Joshi
25-Dec-14 2:58am
View
then use identity(1,1)
sql server will automatically increments value by 1 during inseration of new row
Sid_Joshi
24-Dec-14 0:40am
View
if you wants to update a existing row then why you wants auto increment number?
Sid_Joshi
23-Dec-14 6:56am
View
add linked server for multilocation of database
Sid_Joshi
20-Dec-14 6:49am
View
are you wants code for storing image in sql database?
Sid_Joshi
20-Dec-14 6:43am
View
create a field in sql server with image datatype and save your image in that field.
Sid_Joshi
20-Dec-14 1:18am
View
Use Image
Sid_Joshi
20-Dec-14 1:07am
View
https://www.dropbox.com/s/axukh24jgyo1z1s/FileExplorer.zip?dl=0
Sid_Joshi
19-Dec-14 7:14am
View
It's Possible
Sid_Joshi
18-Dec-14 7:26am
View
click taskbar menu and right click on ASP.Net Deployment Server and select Stop
and run project
Sid_Joshi
18-Dec-14 5:27am
View
yes,
add product id in sql id filed
and image path in sql path column
asp will automatically sets ImageUrl property=your image path
Sid_Joshi
15-Dec-14 3:52am
View
Which Data Control you are using?
Sid_Joshi
11-Dec-14 4:53am
View
Oksidjoshi12@gmail.com
Sid_Joshi
11-Dec-14 4:42am
View
give me ur email I wil send U sample project for doing above task,
Sid_Joshi
11-Dec-14 4:08am
View
image wil not displayed in grid view
Use picturebox to show the image
Sid_Joshi
11-Dec-14 3:30am
View
just change the data type of your image field
I just crearted img table for testing
Sid_Joshi
11-Dec-14 3:25am
View
and Drag Photo field from Database Fields to Your Crystal Report.
Sid_Joshi
11-Dec-14 3:20am
View
Dont Take varchar(max)
use
CREATE TABLE [dbo].[img](
[id] [int] IDENTITY(1,1) NOT NULL,
[photo] [image] NULL
)
Sid_Joshi
6-Dec-14 8:03am
View
already tried it, but still I cant do it
Sid_Joshi
26-Nov-14 5:36am
View
Thanks for your answer...
Sid_Joshi
26-Nov-14 5:08am
View
Thanks For Your Solution....
this will Creates Reverse Effect of Your code
byte i1 = Encoding.Default.GetBytes("Œ")[0];
textBox3.Text = i1.ToString();
Sid_Joshi
21-Nov-14 5:37am
View
What changes should I do in C# to obtain Same behavior like Char() from Vb
Sid_Joshi
5-Nov-14 0:44am
View
It Works..
Thank you for your solution...
Sid_Joshi
17-Oct-14 7:00am
View
Reason for my vote of 1 \n It Gives Error
Msg 227, Level 15, State 1, Line 1
"VALUE" is not a valid function, property, or field.
Sid_Joshi
6-Oct-14 7:47am
View
Thank you for replay on my question.
No, sir I don't heard OpenXML standard can you help me for it?
Sid_Joshi
13-Sep-14 7:26am
View
ok thank u.
Sid_Joshi
13-Sep-14 7:24am
View
code creates excel document but, how to save it to disk?
Sid_Joshi
2-Sep-14 5:28am
View
I posted this answer from my new live project.
from notification module.
Sid_Joshi
2-Sep-14 5:27am
View
I am angry because of devototed my answer 3 times even when my answer is correct.
Sid_Joshi
2-Sep-14 5:23am
View
sorry I don't devote any answer to demotivate other developers.
Sid_Joshi
2-Sep-14 5:15am
View
I pasted from solution 1 because, I thought u don't like my solution and that's y u devoted my solution. and drop down my reputation 16*3.
Sid_Joshi
2-Sep-14 5:09am
View
sorry I don't seen the question Date, but I got link of this question from view all questions.
Sid_Joshi
2-Sep-14 4:15am
View
you down voted my answer 3 times.
Sid_Joshi
2-Sep-14 4:12am
View
you shows more ego..
selfish
Sid_Joshi
2-Sep-14 4:10am
View
then y u devote my answer?
whats your problem with me?
Sid_Joshi
27-Aug-14 8:55am
View
If U wants to draw Charts use System.Windows.Forms.DataVisualization.Charting Reference.
Sid_Joshi
27-Aug-14 8:54am
View
If U wants to draw Charts use System.Windows.Forms.DataVisualization.Charting Reference.
Sid_Joshi
20-Aug-14 3:07am
View
Let's work to help developers, not make them feel stupid.
Sid_Joshi
20-Aug-14 2:51am
View
Thanks RyanDev for your Solution.
and sorry for my misbehavior.
Sid_Joshi
19-Aug-14 9:37am
View
my code requires every time new divider for calculating label height where i wrote 14. it's not fix value. it requires change according to text.
Sid_Joshi
19-Aug-14 9:28am
View
please try to understand my problem by running above code.
If u cant solve my problem then ignore my problem don't try to show your attitude.
Sid_Joshi
19-Aug-14 9:02am
View
I already applied AutoSize=false; with above code and I just wants to adjust label height instead of width.
Sid_Joshi
13-Aug-14 6:58am
View
I mean mdf file creation path.
Sid_Joshi
13-Aug-14 5:18am
View
How to set Restore location for Database?
Sid_Joshi
29-Jul-14 5:23am
View
ex select ASCII ('a') you will get 97 as ascii number add 50 in that numbar character will automatically encrypt
Sid_Joshi
29-Jul-14 5:21am
View
find ascii number of each character and add a specific number to that character ascii number, you will get new number and new encrypted character with that numbar
Sid_Joshi
28-Jul-14 9:30am
View
Which language is best to make program according to your Algorithm?
Sid_Joshi
28-Jul-14 7:14am
View
Sorry, but your question is incomplete.
Can u explain me flow of your project?
Sid_Joshi
26-Jul-14 6:00am
View
Yes, you can write your project name instead FormDemo.
Sid_Joshi
26-Jul-14 5:45am
View
Refer Solution1 or Simple Change namespace of Admission Form
Sid_Joshi
26-Jul-14 5:36am
View
Same code will works for sub folder form.
Sid_Joshi
26-Jul-14 2:23am
View
Can you please explain me your program flow and what you wants to do?
Sid_Joshi
25-Jul-14 2:01am
View
I don't want to stop any system related process just wants to delete suspicious files in Program Files Directory ex. sdfgsdj, tfg, ujuy such files.
Sid_Joshi
24-Jul-14 8:59am
View
I agree with u mr. suresh. but how to find that process to kill. I don't know that process name. otherwise I manually killed that process from Task manager.
Sid_Joshi
24-Jul-14 8:27am
View
I agree with you but can you explain me how to identify and kill that another process.
It's not impossible task I think antivirus programs often runs this tasks to kill process which can cause harm to computer.
Sid_Joshi
24-Jul-14 8:10am
View
By Killing the process that uses the file.
Sid_Joshi
24-Jul-14 8:06am
View
No sir I am trying to remove files from "Debug\f" Directory
Sid_Joshi
24-Jul-14 8:02am
View
Thank you for your Help but, Boss I want To delete some specious files of my Program Files Folder.
Windows not Allowed to delete this Files
That's Y i am writing this program.
Sid_Joshi
21-Jun-14 7:31am
View
Richard MacCutchan can u please help me for creating DSN?
Sid_Joshi
20-Jun-14 9:01am
View
not working means it not allows to add ms access DSN. and show error something like that "Driver not Installed"
Sid_Joshi
8-Jan-14 0:52am
View
Thanks for suggestion
I wants to show ListBox with auto suggest list options under the TextBox but I cant find out the Location for placing ListBox.
You are right it's tightly coupled task but how we can manage this by other way?
Sid_Joshi
7-Jan-14 7:47am
View
false;
removeComp();
}
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
listBox1.Items.Clear();
if (this.TextLength != 0)
{
//listBox1.Visible = true;
putComp();
DataRow[] dr = dt.Select(dt.Columns[0].Caption + " like '" + this.Text + "%'");
foreach (DataRow row in dr)
{
listBox1.Items.Add(row[0].ToString());
}
}
else
//listBox1.Visible = false;
removeComp();
}
private void parent_Resize(object sender, EventArgs e)
{
if (listBox1.Items.Count > 0)
{
removeComp();
putComp();
}
}
private void parent_ResizeEnd(object sender, EventArgs e)
{
if (listBox1.Items.Count > 0)
{
removeComp();
putComp();
}
}
private void parent_Move(object sender, EventArgs e)
{
if (listBox1 != null)
{
if (listBox1.Items.Count > 0)
{
removeComp();
putComp();
}
}
}
private void listBox1_Click(object sender, EventArgs e)
{
parent.Focus();
}
}
}
in ths user control code i m trying to find parent form bt it returns null
Sid_Joshi
7-Jan-14 7:45am
View
namespace WindowsFormsApplication2
{
public partial class AutoSuggest : System.Windows.Forms.TextBox
{
public AutoSuggest()
{
InitializeComponent();
initControl();
}
int index = -1;
ListBox listBox1;
Form f3;
private DataTable dt;
Form parent;
public DataTable DataSource
{
get { return dt; }
set { dt = value; }
}
protected void initControl()
{
listBox1 = new ListBox();
listBox1.KeyDown += new KeyEventHandler(listBox1_KeyDown);
listBox1.DoubleClick += new EventHandler(listBox1_DoubleClick);
f3 = new Form();
f3.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
f3.ShowInTaskbar = false;
f3.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.KeyDown += new KeyEventHandler(textBox1_KeyDown);
this.TextChanged += new EventHandler(textBox1_TextChanged);
parent = (Form)FindForm();
//parent.Resize += new EventHandler(parent_Resize);
//parent.ResizeEnd += new EventHandler(parent_ResizeEnd);
//parent.Move += new EventHandler(parent_Move);
listBox1.Click += new EventHandler(listBox1_Click);
}
private void listBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.Text = listBox1.Text;
this.Select(this.Text.Length, 0);
listBox1.Items.Clear();
index = -1;
//listBox1.Visible = false;
removeComp();
}
}
private void listBox1_DoubleClick(object sender, EventArgs e)
{
this.Text = listBox1.Text;
this.Select(this.Text.Length, 0);
listBox1.Items.Clear();
index = -1;
//listBox1.Visible = false;
removeComp();
}
public void putComp()
{
Point location = this.PointToScreen(Point.Empty);
int x = location.X-1;
int y = location.Y + this.Height-2; //Down to textBox
//int y = textBox1.Location.Y -95; //Up to textBox
//int y = this.Location.Y + textBox1.Location.Y + textBox1.Height + 22;
f3.Location = new System.Drawing.Point(x, y);
f3.Width = this.Width;
f3.Height = 200;
//listBox1.Location = new System.Drawing.Point(0, 0);
listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
f3.TopMost = true;
f3.Show();
f3.Controls.Add(listBox1);
this.Focus();
}
public void removeComp()
{
f3.Hide();
f3.Controls.Remove(listBox1);
index = -1;
}
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (listBox1.Items.Count > 0)
{
if (e.KeyCode == Keys.Down)
{
index++;
if (index >= listBox1.Items.Count - 1)
{
index = listBox1.Items.Count - 1;
}
}
if (e.KeyCode == Keys.Up)
{
index--;
if (index <= 0)
{
index = 0;
}
//textBox1.Select(textBox1.TextLength, 0);
e.SuppressKeyPress = true;
}
listBox1.SelectedIndex = index;
if (e.KeyCode == Keys.Enter)
{
this.Text = listBox1.Text;
this.Select(this.Text.Length, 0);
listBox1.Items.Clear();
index = -1;
//listBox1.Visible =
Sid_Joshi
7-Jan-14 5:08am
View
I can't understand what you wants to talk.
Sid_Joshi
7-Jan-14 4:25am
View
Can u explain me with code?
Sid_Joshi
7-Jan-14 4:15am
View
AutoSuggest is a User control I wants to build
Please help me to build
thanks in advance
Sid_Joshi
7-Jan-14 4:10am
View
//listBox1.Visible =false;
removeComp();
}
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
listBox1.Items.Clear();
if (this.TextLength != 0)
{
//listBox1.Visible = true;
putComp();
DataRow[] dr = dt.Select(dt.Columns[0].Caption + " like '" + this.Text + "%'");
foreach (DataRow row in dr)
{
listBox1.Items.Add(row[0].ToString());
}
}
else
//listBox1.Visible = false;
removeComp();
}
private void parent_Resize(object sender, EventArgs e)
{
if (listBox1.Items.Count > 0)
{
removeComp();
putComp();
}
}
private void parent_ResizeEnd(object sender, EventArgs e)
{
if (listBox1.Items.Count > 0)
{
removeComp();
putComp();
}
}
private void parent_Move(object sender, EventArgs e)
{
if (listBox1 != null)
{
if (listBox1.Items.Count > 0)
{
removeComp();
putComp();
}
}
}
private void listBox1_Click(object sender, EventArgs e)
{
parent.Focus();
}
}
}
Sid_Joshi
7-Jan-14 3:53am
View
namespace WindowsFormsApplication2
{
public partial class AutoSuggest : System.Windows.Forms.TextBox
{
public AutoSuggest()
{
InitializeComponent();
initControl();
}
int index = -1;
ListBox listBox1;
Form f3;
private DataTable dt;
Form parent;
public DataTable DataSource
{
get { return dt; }
set { dt = value; }
}
protected void initControl()
{
listBox1 = new ListBox();
listBox1.KeyDown += new KeyEventHandler(listBox1_KeyDown);
listBox1.DoubleClick += new EventHandler(listBox1_DoubleClick);
f3 = new Form();
f3.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
f3.ShowInTaskbar = false;
f3.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.KeyDown += new KeyEventHandler(textBox1_KeyDown);
this.TextChanged += new EventHandler(textBox1_TextChanged);
parent = (Form)FindForm();
//parent.Resize += new EventHandler(parent_Resize);
//parent.ResizeEnd += new EventHandler(parent_ResizeEnd);
//parent.Move += new EventHandler(parent_Move);
listBox1.Click += new EventHandler(listBox1_Click);
}
private void listBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.Text = listBox1.Text;
this.Select(this.Text.Length, 0);
listBox1.Items.Clear();
index = -1;
//listBox1.Visible = false;
removeComp();
}
}
private void listBox1_DoubleClick(object sender, EventArgs e)
{
this.Text = listBox1.Text;
this.Select(this.Text.Length, 0);
listBox1.Items.Clear();
index = -1;
//listBox1.Visible = false;
removeComp();
}
public void putComp()
{
Point location = this.PointToScreen(Point.Empty);
int x = location.X-1;
int y = location.Y + this.Height-2; //Down to textBox
//int y = textBox1.Location.Y -95; //Up to textBox
//int y = this.Location.Y + textBox1.Location.Y + textBox1.Height + 22;
f3.Location = new System.Drawing.Point(x, y);
f3.Width = this.Width;
f3.Height = 200;
//listBox1.Location = new System.Drawing.Point(0, 0);
listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
f3.TopMost = true;
f3.Show();
f3.Controls.Add(listBox1);
this.Focus();
}
public void removeComp()
{
f3.Hide();
f3.Controls.Remove(listBox1);
index = -1;
}
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (listBox1.Items.Count > 0)
{
if (e.KeyCode == Keys.Down)
{
index++;
if (index >= listBox1.Items.Count - 1)
{
index = listBox1.Items.Count - 1;
}
}
if (e.KeyCode == Keys.Up)
{
index--;
if (index <= 0)
{
index = 0;
}
//textBox1.Select(textBox1.TextLength, 0);
e.SuppressKeyPress = true;
}
listBox1.SelectedIndex = index;
if (e.KeyCode == Keys.Enter)
{
this.Text = listBox1.Text;
this.Select(this.Text.Length, 0);
listBox1.Items.Clear();
index = -1;
Sid_Joshi
1-Jan-14 3:50am
View
Thank you and Happy New Year!!!
Sid_Joshi
1-Jan-14 3:46am
View
Thank you and Happy New Year!!!
Sid_Joshi
1-Jan-14 3:44am
View
Deleted
Thank you and Happy New Year!!!
Sid_Joshi
1-Jan-14 3:44am
View
Thank you and Happy New Year!!!
Sid_Joshi
1-Jan-14 2:30am
View
Thank you!!! and Happy New Year!!
Sid_Joshi
19-Dec-13 5:42am
View
I am using eclipse IDE and android emulator
192.168.1.16 is my computer's IP
Sid_Joshi
4-Dec-13 6:12am
View
It works..
Thanks for Help.
How can I read entire web page by this code?
Sid_Joshi
4-Dec-13 1:34am
View
It shows
Unfortunately, ThreadURL has Stopped
12-04 06:31:22.368: I/info(1162): text: <!DOCTYPE html>
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.TextView.invalidateRegion(TextView.java:4395)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.TextView.invalidateCursor(TextView.java:4338)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.TextView.spanChange(TextView.java:7186)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.TextView$ChangeWatcher.onSpanAdded(TextView.java:8821)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java:979)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:688)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:588)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.text.Selection.setSelection(Selection.java:76)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.text.Selection.setSelection(Selection.java:87)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java:302)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.TextView.setText(TextView.java:3555)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.TextView.setText(TextView.java:3425)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.EditText.setText(EditText.java:80)
12-04 06:31:22.508: E/AndroidRuntime(1162): at android.widget.TextView.setText(TextView.java:3400)
Sid_Joshi
4-Dec-13 1:23am
View
Deleted
It shows
Unfortunately, ThreadURL has Stopped
12-04 06:21:06.737: E/AndroidRuntime(1057): FATAL EXCEPTION: Thread-98
12-04 06:21:06.737: E/AndroidRuntime(1057): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:4746)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:854)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.view.ViewGroup.invalidateChild(ViewGroup.java:4077)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.view.View.invalidate(View.java:10322)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.TextView.invalidateRegion(TextView.java:4395)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.TextView.invalidateCursor(TextView.java:4338)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.TextView.spanChange(TextView.java:7186)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.TextView$ChangeWatcher.onSpanAdded(TextView.java:8821)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java:979)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:688)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:588)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.text.Selection.setSelection(Selection.java:76)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.text.Selection.setSelection(Selection.java:87)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java:302)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.TextView.setText(TextView.java:3555)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.TextView.setText(TextView.java:3425)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.EditText.setText(EditText.java:80)
12-04 06:21:06.737: E/AndroidRuntime(1057): at android.widget.TextView.setText(TextView.java:3400)
12-04 06:21:06.737: E/AndroidRuntime(1057): at com.example.threadurl.ThreadActivity$2.run(ThreadActivity.java:61)
12-04 06:21:06.737: E/AndroidRuntime(1057): at java.lang.Thread.run(Thread.java:856)
12-04 06:21:06.897: D/dalvikvm(1057): GC_CONCURRENT freed 375K, 17% free 2599K/3116K, paused 77ms+98ms, total 348ms
Sid_Joshi
3-Dec-13 4:37am
View
Till having problem
the application unfortunately closes
what precaution should i take to run this application?/
please help me i am new in android development
Show More