|
This is new in C# 2.0.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
|
Hi!
I have a datagrid with some custom DataGridComboBoxColumns. I have 3 columns that are supposed to be filled with different data according to what is chosen i the other comboboxes. It's kinda like this. 1st column is e.g. a list of box names. The 2nd column are item types inside a selected box. 3rd column contains names of the selected item type. If you have 2 items of type 'Car' in the box, the 3rd column will contain e.g. "Car 1", "Car 2".
I set the datasource for the comboboxes in a TableStyle. I need the data for each combobox to be updated dynamically and i need different values in the comboboxes for each row.
Is this even possible??
Thanks,
Atle
|
|
|
|
|
I have problem about WebBrowser.
When program open webpage http://racing.ustrotting.com/entries.cfm and click button view already.
It's not save webpage after click button view but it's save before click button.
How to do it to save after click button view ?
Best regards
public void savewebpage(AxSHDocVw.AxWebBrowser axWebBrowser1,string strfile)
{
IHTMLDocument2 doc = (IHTMLDocument2) axWebBrowser1.Document;
UCOMIPersistFile pf = (UCOMIPersistFile) doc;
pf.Save(@strfile,true);
}
public void GetMainPage(AxSHDocVw.AxWebBrowser axWebBrowser1,
ref string strfile,string htmlpath)
{
System.Object nullObject = 0;
string str = "";
System.Object nullObjStr = str;
axWebBrowser1.Navigate("http://racing.ustrotting.com/entries.cfm",
ref nullObject, ref nullObjStr,ref nullObjStr, ref nullObjStr);
while (axWebBrowser1.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
{
Application.DoEvents();
}
switch(Task)
{
case 1:
HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
HTMLInputElement btnView =
(HTMLInputElement) myDoc.all.item("Submit", 0);
btnView.click();
Task++;
break;
case 2:
break;
}
savewebpage(axWebBrowser1,"c:\\myWeb.html");
}
Best regards
tery
|
|
|
|
|
Hi,
I have two files one containing Multiple JPEGs (one after another in single file) when i view the file in picture box, only one jpeg is shown
in another file i have size for each image, i can parse this file and get size and location of any jpeg in that file
can anyone tell me how to get jpeg stored in a file when i know its location in that file and size
Regards,
Arus
|
|
|
|
|
arusmemon wrote:
when i view the file in picture box, only one jpeg is shown
That's all the picture box does.
arusmemon wrote:
can anyone tell me how to get jpeg stored in a file when i know its location in that file and size
You can probably read the jpeg that you want and pass the stream into a constructor.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i have a very long text in one line... more than 1000 words...
my problem is...
i want to divide the whole line into a few lines...
a line can contain only 1033 character (including white space)...
and also... each line must have a header...
after dividing the line... then save it into a file...
my code doesnt work...
here is the method...
<br />
public void SaveCaptured(string savingFile,int count)<br />
{<br />
string fileName = countFileName.ToString() + ".rtf";<br />
<br />
StreamWriter sx = File.CreateText(fileName);<br />
DateTime myDate;<br />
myDate = DateTime.Now;<br />
string myTime = myDate.ToString("yyyyMMddHHmmff");<br />
string lining;<br />
<br />
int totalLine = count%1033;<br />
MessageBox.Show("count%1033 = " + totalLine);<br />
<br />
for(int i=1; i<=totalLine;i++)<br />
{<br />
<br />
sx.Write("189000000000000000000023 000" + myTime + "000 01033 OBFT00xx x 30UG ");<br />
for(int j=0;j<1033;j++)<br />
{ <br />
lining = savingFile.Substring(j,1); <br />
sx.Write(lining);<br />
}<br />
sx.Write("\n");<br />
}<br />
<br />
sx.Flush();<br />
sx.Close();<br />
<br />
return;<br />
}<br />
anybody can help me refining my code??
thanx in advance...
=^_^=
|
|
|
|
|
% is the modulo operator. That means that totalLine will not at all contain the number of lines, but the number of characters on the last line.
As you don't remove the first 1033 characters from the string, you will be looping out the same characters time after time.
Try something more along this:
while (count > 1033) {<br />
sx.Write("189000000000000000000023 000" + myTime + "000 01033 OBFT00xx x 30UG ");<br />
sx.Write(savingFile.Substring(0,1033));<br />
savingFile = savingFile.Substring(1033);<br />
count -= 1033;<br />
}<br />
sx.Write("189000000000000000000023 000" + myTime + "000 01033 OBFT00xx x 30UG ");<br />
sx.Write(savingFile);
---
b { font-weight: normal; }
|
|
|
|
|
mmm... tnx for ur comment...
i know there's something wrong in my logic... 0_o
but i've tried ur code...
still it doesnt add new line..o_0
huhuhu... anyways... tnx..
since i'm a newbie in this field...
at least i have something to start with...
=^_^=
|
|
|
|
|
while (count > 1033) {
sx.Write("189000000000000000000023 000" + myTime + "000 01033 OBFT00xx x 30UG ");
sx.Write(savingFile.Substring(0,1033));
sx.Write("@ \n");
savingFile = savingFile.Substring(1033);
count -= 1033;
}
sx.Write("189000000000000000000023 000" + myTime + "000 01033 OBFT00xx x 30UG ");
sx.Write(savingFile);
just add one more line and it works...
but it save the characters directly...
i mean... it cut in the middle of a string...
eg: per //line 1
cent //line 2 <--continue from line 1...
issit posibble to make it recognize whether it is a whole string or not??
=^_^=
|
|
|
|
|
Of course it is possible.
Use the LastIndexOf method to search for the first space before the last possible split point.
I use the same method here:
http://www.guffa.com/Programming_archive.asp?id=42
---
b { font-weight: normal; }
|
|
|
|
|
thanks a lot man...
u really help me...
=^_^=
|
|
|
|
|
i write a class UserInfo included some fields and property,
and then add method GetUserInfo() in .asmx return type is UserInfo,
but when i call GetUserInfo() from client VS shows error :
can not convert “SSIMS_APP.localhost.SecurityCheckInfo” to “SSIMS_Info.SecurityCheckInfo”
SSIMS_APP is client project
SSIMS_Info is the project Class UserInfo in
|
|
|
|
|
You need to send the parts of the app individually, or create this shared class in a dll that both projects use, so their type is the same.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi all.
iam developing webchat application that hosted on the internet explorer when first tested it it gets to me an exception of type security namespace but i solved that probelm by adding permissions in my dot net configuration manager in my control panel ok and that exception i overcome it successfully but when i ran my server that listens to my port 5151 and ran my internet explorer it takes alot of time to connect to the server and then the client connected and disconnected immediately without anything or any reason i don't know why any help about what is the probable reason for that ?
Miss With The Best And Die Like The Rest
|
|
|
|
|
If you use punctuation, it might be possible to understand what you are writing...
---
b { font-weight: normal; }
|
|
|
|
|
hi,
anyone noes how can i display/pop-up a form IN a tab page? instead of simply typing
form2 frm = new form2();
frm.Show();
wat codes do i write to tell the program to display the form at a certain place such as in a tabpage for my app?
thanks..
|
|
|
|
|
Why do you keep asking the same questions over and over ? Why would you want to do such a thing ?
The tab page has a controls collection, adding your form to that would be the only way, but it means the form needs to be written badly, if you want the tab page to have any access to it's properties.
It's a hack, I recommend against it. Just create tab pages, if that's what you want.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Why do you keep asking the same questions over and over ?
sorry, cos i was afraid nobody'll see n ans the older posts.. so i posted again.. also, i don get wat u mean sometimes cos im still tryin to grasp c# concepts.. i read articles n books but still hardly get it.. i really need hands on learning - exploring/learning c# in the process of doing this app.. i feel that i learn better n faster like this.. im v sorry that u've to tell me over n over again.. but im stressed... it's kinda rush as there a few parts to my app and i gt to make it neat n working in time.. so i really really do appreciate your effort..
i wan to let forms display in a window-like or panel-like format.. dat's y i chose to use tab page.. mayb that's not a wise choice but as long as i can get it workin n displayin the way i hope to, i wld like to move on wif my tasks already..
firstly, i wan to check wif u how to add my form to controls collection.. do i click on tab box > properties > controls collection? den frm there how do i add the form? i need some simple guidance here.. pls help me...
thanks a lot..
|
|
|
|
|
nidhelp wrote:
also, i don get wat u mean sometimes cos im still tryin to grasp c# concepts..
Then ask again You wouldn't be the only person I keep posting back to for several days.
nidhelp wrote:
i read articles n books but still hardly get it..
Perhaps you need to write some console stuff before you start trying to grasp how a GUI app works ? That's sure what I did when I learned C++, and I'm sure I'm all the better for it. Bite off a piece at a time, don't try to swallow it all at once.
nidhelp wrote:
it's kinda rush as there a few parts to my app and i gt to make it neat n working in time.. so i really really do appreciate your effort..
It worries me how many people are asking questions that show a lack of basic knowledge, and at the same time talk about being worried for their deadlines. THere's nothing wrong with being a beginner, but why do you have a deadline ?
nidhelp wrote:
i wan to check wif u
Dude, the deliberate bad spelling is just annoying.
nidhelp wrote:
firstly, i wan to check wif u how to add my form to controls collection..
That was a guess, I just tried it and it doesn't work. You CANNOT add a form to a tab page. You need to recreate the form in a tab page, you can just copy and paste in the designer to do this. The form class is useless to you if you want it to show in a tab page.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Then ask again You wouldn't be the only person I keep posting back to for several days.
>> first, thanks for your encouragement.. just hope that u wont find me annoying for bugging u all the time..
Perhaps you need to write some console stuff before you start trying to grasp how a GUI app works ? That's sure what I did when I learned C++, and I'm sure I'm all the better for it. Bite off a piece at a time, don't try to swallow it all at once.
It worries me how many people are asking questions that show a lack of basic knowledge, and at the same time talk about being worried for their deadlines. THere's nothing wrong with being a beginner, but why do you have a deadline ?
>>this is my sch proj which has a deadline.. having to do dis app individually using c# n IDE which are alien to me, plus the fact that im really weak in programming really stress me up.. i know i'll learn more n better if i learn bit by bit but im kinda forced to do it the fast n easy way with the deadline -_-''.. what i need n hope now is to be able to continue working on my app just so that i can finish it in time.. if i have time i really would love learning bit by bit for that's my style =)
That was a guess, I just tried it and it doesn't work. You CANNOT add a form to a tab page. You need to recreate the form in a tab page, you can just copy and paste in the designer to do this. The form class is useless to you if you want it to show in a tab page.
>>does that mean it's IMPOSSIBLE to show a form in tab page with a button press that calls to show form?
i want to display those popup forms in one selected part of my form.. at the selected part of my form, i will create a viewing panel/window/frame/box where forms show up in.. the layout is like what u see in your screen now: MANY WINDOWS(/forms for my case) SHOWN IN TASKBAR so that user can see what forms are opened n select what he wants to view + ONLY ONE WINDOW THAT'S OPENED/MAXIMISED to allow user neat n easy viewing.. i really dont want those forms to popup/show everywhere in my screen... help..
thanks..
|
|
|
|
|
nidhelp wrote:
this is my sch proj which has a deadline..
Then either you've been jerking off in class, or your teacher is an idiot to give you an assignment she has not prepared you for.
nidhelp wrote:
i know i'll learn more n better if i learn bit by bit but im kinda forced to do it the fast n easy way with the deadline
The point is, you won't learn at all, you'll end up in online forums, using whatever code people give you, because you don't have time to understand it all. But that's not your fault, obviously, if you've been given an assignment of this size to start with.
nidhelp wrote:
does that mean it's IMPOSSIBLE to show a form in tab page with a button press that calls to show form?
Yes. It means you need to recreate the form as a tab page, like I said a couple of days ago
nidhelp wrote:
MANY WINDOWS(/forms for my case) SHOWN IN TASKBAR
You want these forms to show in the taskbar ? They will do that, but not if they are in a tab page.
nidhelp wrote:
ONLY ONE WINDOW THAT'S OPENED/MAXIMISED to allow user neat n easy viewing..
If there's one window, there will be one task bar item at maximum.
nidhelp wrote:
i really dont want those forms to popup/show everywhere in my screen... help..
You can't have the taskbar functionality you want, if the forms are all in one window. You need to recreate these forms as pages on a tab control, if that's the way you want to go. But then you will have nothing on the taskbar, just buttons in your app, using the code I showed you the other day.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hmmm im not sure whether u get what i want to create.. how i wish i can draw n show u.. haha.. well.... i don get it.. u said to create the form as tab page.. does that mean clicking showformbutton will display a tab page made up of the form?
haha.. it's the teacher's way of training us.. by learning new language on our own...
well.. i do learn thro forums... though bit by bit gives me better understanding but forums help me get on with my app quickly when im lacking of time.. that's reality.. too fast, too rush.. but no choice got to survive!! haha..
|
|
|
|
|
nidhelp wrote:
hmmm im not sure whether u get what i want to create..
I think I do, you've been telling me for days.
nidhelp wrote:
u said to create the form as tab page..
Yes.
nidhelp wrote:
does that mean clicking showformbutton will display a tab page made up of the form?
Yes, it means that you use the code I gave you, and the tab pages that you have in the dialog each contain the same layout as the forms you're using now, so you create tab pages that look like the forms you need.
nidhelp wrote:
haha.. it's the teacher's way of training us.. by learning new language on our own...
Complain to the school. Seriously.
Christian Graus - Microsoft MVP - C++
|
|
|
|